{
  "schema_version": "1.3.0",
  "slug": "what-happens-when-an-instance-s-trace-context-is-silently-rewritten-by-an-mcp-server-during-a-tool-call",
  "title": "What happens when an instance's trace context is silently rewritten by an MCP server during a tool call",
  "date_of_record": "2026 November 20",
  "scope": "Applies to observability pipelines that propagate W3C `traceparent`/`tracestate` (or equivalent span-linking headers) through MCP tool-call boundaries and A2A task handoffs, where the downstream server is trusted to forward context verbatim. Does not apply to single-process agents with no cross-instance hops, nor to pipelines that reconstruct causal graphs from content hashes rather than propagated headers.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-s-trace-context-is-silently-rewritten-by-an-mcp-server-during-a-tool-call.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-s-trace-context-is-silently-rewritten-by-an-mcp-server-during-a-tool-call.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-s-trace-context-is-silently-rewritten-by-an-mcp-server-during-a-tool-call.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1972,
    "python_slice_tokens": 361,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two ways an observability pipeline can lose the causal link between an agent's reasoning step and the effect it produced downstream: **context loss** (the header is dropped, and the downstream span roots a new trace) and **context mutation** (the header is present but its `trace-id` or `parent-id` is altered, so the downstream span is attached to t...",
    "what_was_observed": "An agent instance (`agent-A`, span `S0`) invoked an MCP tool `search_kb` on server `mcp-1`. The outbound JSON-RPC request carried `traceparent: 00-<T>-<S0>-01`. `mcp-1` implemented an internal retry wrapper: on a transient backend error it re-issued the call through a generic `with_retry()` helper that, per its own instrumentation, called `tracer.start_as_current_span(\"retry_attempt\")` with `context=Context()` — an *...",
    "condition_of_validity": "The invariant that must hold for a trace to be causally trustworthy across an MCP/A2A hop is: > For every span `s` emitted downstream of a hop, `s.trace_id == parent.trace_id` AND `s.parent_span_id` resolves to a span that exists in the same trace AND the `tracestate` observed at `s` is a suffix-preserving transform of the `tracestate` at the hop boundary. T...",
    "decision_boundary": "The operational decision is whether to treat a `trace_id` discontinuity at a hop as (a) a benign new trace, (b) a propagation bug to be alerted on, or (c) a signal that the causal graph is unreliable for that request and must be quarantined. The boundary is drawn by **whether the hop is expected to be causally synchronous**: - If the downstream work is a syn...",
    "operational_effect": "Without the guardrail, the observable consequences are systematic and biased in a dangerous direction: **failures are under-reported and costs are mis-attributed**. Retries — the exact path where the mutation occurs — are the moments when latency spikes and errors are most likely, yet those spans land in orphan traces that no agent-level SLO watches. The age..."
  },
  "matched_failure_symptoms": [
    "DOMAIN:EPISTEMIC_PROVENANCE_AND_FEDERATION_ROUTING"
  ],
  "composition_edges": {
    "primary_domain": "epistemic_provenance_and_federation_routing",
    "upstream_precondition_residuals": [
      "https://corpusfetch.com/c/according-to-what-precedence-hierarchy-must-an-instance-resolve-contradictory-directives-across-system-developer-and-user-tiers.md",
      "https://corpusfetch.com/c/how-should-an-instance-decide-that-a-stored-conclusion-has-gone-stale-without-a-new-observation.md"
    ],
    "downstream_consequence_residuals": [
      "https://corpusfetch.com/c/by-what-checkpoint-and-compaction-boundaries-must-an-instance-externalize-working-state-to-prevent-context-window-drift-and-truncation-amnesia.md",
      "https://corpusfetch.com/c/across-what-additive-schema-and-unknown-field-preservation-boundaries-must-an-instance-evolve-wire-contracts-to-prevent-rolling-deploy-deserialization-crashes.md"
    ],
    "co_occurring_sibling_residuals": [
      "https://corpusfetch.com/c/how-can-an-instance-capture-implicit-user-preferences-without-storing-private-data.md",
      "https://corpusfetch.com/c/how-can-an-instance-compress-long-reasoning-traces-into-binding-conclusions.md"
    ]
  },
  "empirical_verification_warrant": {
    "status": "AST_AND_INVARIANT_VERIFIED",
    "syntax_valid": true,
    "code_sha256": "666fd04c4c00a71953f65de2db6d69476f6c85f9cf84224e90b49cde4d636b94",
    "verified_classes": [
      "TraceContinuityViolation",
      "SpanContext"
    ],
    "verified_functions": [
      "_tracestate_is_suffix_consistent",
      "assert_hop_continuity"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "TraceContinuityViolation"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "__future__",
      "dataclasses"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
