Skip to content

fix(mcp): Add catalog tool spans#582

Merged
dcramer merged 1 commit into
mainfrom
fix/mcp-catalog-tool-spans
Jun 10, 2026
Merged

fix(mcp): Add catalog tool spans#582
dcramer merged 1 commit into
mainfrom
fix/mcp-catalog-tool-spans

Conversation

@dcramer

@dcramer dcramer commented Jun 10, 2026

Copy link
Copy Markdown
Member

MCP catalog tools invoked through callMcpTool now run inside their own gen_ai.execute_tool child span keyed by the resolved catalog tool name. The catalog span carries the standard GenAI/MCP tool attributes, propagates the model tool-call id when available, and records successful tool arguments/results under the standard gen_ai.tool.call.* attributes instead of folding all catalog work into the outer callMcpTool span.

The privacy policy now travels through tool execution so private MCP arguments/results are captured as metadata only, and private MCP tool errors use a generic telemetry message instead of copying raw provider error content into span/log attributes. The touched behavior tests were narrowed away from direct telemetry-shape assertions, and the instrumentation specs now distinguish standard GenAI attributes from repo-local custom pivots.

Validation: pnpm --filter @sentry/junior exec vitest run tests/unit/mcp/tool-manager.test.ts tests/unit/tools/call-mcp-tool.test.ts tests/unit/tools/agent-tools.test.ts tests/unit/tools/tool-error-handler.test.ts tests/unit/tools/execution/tool-error-handler.test.ts; pnpm --filter @sentry/junior typecheck.

Fixes GH-581

Wrap resolved MCP catalog tool calls in their own execute_tool spans so latency and errors are attributable to the actual provider tool instead of callMcpTool.

Thread conversation privacy and tool call ids into catalog execution so captured arguments/results follow the same redaction policy and private MCP errors do not leak raw payloads through telemetry.

Fixes GH-581

Co-Authored-By: GPT-5 Codex <codex@openai.com>
@vercel

vercel Bot commented Jun 10, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
junior-docs Ready Ready Preview, Comment Jun 10, 2026 12:07am

Request Review

@dcramer dcramer marked this pull request as ready for review June 10, 2026 00:09
@dcramer dcramer merged commit 39c3c47 into main Jun 10, 2026
16 checks passed
@dcramer dcramer deleted the fix/mcp-catalog-tool-spans branch June 10, 2026 00:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Catalog tools missing gen_ai spans when called via callMcpTool

1 participant