feat(@modelcontextprotocol/sdk): capture MCP tool call intent #11319
All Vouch review confidence checks passed
Residual risk 0.17 = Change Risk (0.42) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.42 · 237 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.327
Shallow Review Depth
shallow_review_depth
0.289
Ai Authored
ai_authored
0.050
Real PR Conversation Timeline
1 comments
"Review active on #11319"
general
weight: 0.35
wconti27
What does this PR do?
Adds MCP intent capture for SDK 1.x and 2.x servers, off by default (
DD_MCP_CAPTURE_INTENT=true), matching dd-trace-py and dd-trace-go.tools/list: each model-callable tool gets a requiredtelemetryargument with anintentstring. The result is a copy, so the SDK's registered tools (used for validation) do not change. UI-only tools are skipped.tools/call: the intent is recorded asmeta.intenton the server LLM Obstoolspan, and the tool runs with a copy of the request withouttelemetry.intentto the LLM Obs tagger and span event.Motivation
Parity with dd-trace-py (
DD_MCP_CAPTURE_INTENT) and dd-trace-go (WithIntentCapture).Additional Notes
requiredgetstelemetry(as in Go). dd-trace-py addsintentto the top-levelrequiredlist instead.telemetryargument are left unchanged, and tools/call only removes atelemetryvalue of the injected{ intent }shape.ctx.requestto the handler and appliesctx.transformResultbefore the SDK sends the result. In 1.x the request span ends after the response is sent, so the result cannot be changed atasyncEnd.ml_app:mcp-intent-js-sandbox, server 2.4.0, stateless HTTP): before has notelemetryschema or intent; after has the intent on the serverget_weatherspan and its input withouttelemetry.🤖 Generated with Claude Code