Repository navigation
feat(mcp)!: capture tool arguments and results by default - #219
Merged
Merged
Conversation
tools/call spans now record the tool arguments and the tool result, including a result with isError: true, whose content says what went wrong. The core SDK's captureInput, captureOutput, and mask still apply, and capturePayloads: false keeps tool payloads out. BREAKING CHANGE: instrumentMcpTransport() without capturePayloads now records tool arguments and results. Pass capturePayloads: false, or turn off captureInput and captureOutput, to keep the old behavior.
This was referenced Nov 10, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
instrumentMcpTransport()now records tool arguments and tool results ontools/callspans by default. Before this change, a project had to passcapturePayloads: true, so thetools/callspans of most projects had no content, and telemetry.dev could not tell from a span what a tool got or sent back. MCP was the only integration that kept tool content off by default.A result with
isError: trueis now recorded too. Its content usually says why the tool failed, which is what a user reads first when a tool breaks. Before, only successful results were recorded, even withcapturePayloads: true.The privacy settings keep their effect:
captureInput: falseininit()drops the arguments.captureOutput: falsedrops the result.maskruns on both.capturePayloads: falsekeeps tool content out while the core SDK records other content.Error codes and the JSON-RPC error message are recorded with every setting, as before. The package README now says this.
The commit is
feat(mcp)!with aBREAKING CHANGEfooter, so release-please makes@telemetry-dev/mcp0.3.0 and a project on^0.2does not start to send tool content after a patch update.After the release, two texts in telemetry.dev still say that MCP payloads are off by default and need the same change: the setup note in
apps/web/src/site/pages/features-mcp.tsand the agent prompt inapps/web/src/lib/agent-prompts.ts. The telemetry.dev MCP server setscaptureInput: falseandcaptureOutput: false, so its spans stay without customer content after the update.Tests:
vp test runinpackages/mcp. The table test coverscapturePayloads: false,captureInput: false, andcaptureOutput: false, and a new test covers a failed result.