Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

MCP: expose span status and status message in inspect_span

Abierto
#1,873 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
68/100
Tipo de issue
Nueva funcionalidad
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
typescript

Línea de trabajo

Start by reading packages/domain/src/mcp-outputs/traces.ts to compare TraceSpanOutput, which already carries status, against InspectSpanOutput, which does not. Then follow apps/ai/src/mcp/tools/inspect-span.ts for the handler and renderer, using apps/ai/src/mcp/lib/render-trace.ts as the rendering reference; check whether the span-detail query already selects statusCode/statusMessage before extending it. Done looks like structured and text output showing Unset, Ok, and Error distinctly, agreeing with inspect_trace, plus tests for error-with-message, error-without-message, Ok, Unset, and missing span.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Problem

An agent inspecting one span cannot read its explicit OpenTelemetry status from inspect_span. The tool returns span attributes, resource attributes, and an optional AI decode, but its output schema and renderer omit statusCode and statusMessage.

A Worker can catch a failed operation, mark its custom span as an error, and still return a successful HTTP response. An agent needs that span status to understand the operation's result. Currently it must fetch inspect_trace separately, which already exposes these fields.

Why this matters for Cloudflare now

Cloudflare's October 26, 2026 Workers tracing update adds span.setStatus() to native custom spans. The explicit status and optional error message are included in exported OTLP traces, while the Workers Observability dashboard does not yet show span status.

This makes the existing MCP output gap more useful to close. The feature should work for spans from all OpenTelemetry producers.

Current code

Checked against main at 7edfccb17c3f524f9d793e0a11893fcf0535737e:

Proposed change

Expose the stored statusCode and statusMessage in both the structured and text results of inspect_span. Keep existing attributes, AI decoding, and missing-span behavior. Extend the span-detail query if needed.

Keep HTTP response status and OpenTelemetry span status separate. Do not infer an explicit Ok from a missing or unset status.

Acceptance criteria

  • inspect_span returns and renders the stored status and error message for a found span.
  • Unset, Ok, and Error remain distinct and agree with inspect_trace for the same span.
  • A custom span marked Error remains visible as failed even when the enclosing HTTP request succeeds.
  • Tests cover an error with a message, an error without a message, Ok, Unset, and a missing span.
  • Include a native Workers OTLP fixture using setStatus({ code: "error", message: "Probe failed" }), or verify the same path with a small Worker export.

Evidence: source inspection. A live Cloudflare-to-Maple export has not been tested for this report.

Lenguaje dominante
TypeScript
Estrellas
1.8k
Forks
120
Merge medio
8 h 11 min
PR fusionados (30 d)
667

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de MapleTechLabs/maple

Todos los issues de MapleTechLabs/maple

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.