Skip to content

feat(attributes): deprecate legacy MCP tool result fields - #689

Merged
betegon merged 3 commits into
mainfrom
bt/mcp-result-conventions
Oct 9, 2026
Merged

betegon merged 3 commits into
mainfrom
bt/mcp-result-conventions

Conversation

@betegon

@betegon betegon commented Oct 8, 2026 •

Copy link
Copy Markdown
Member

Description

Use gen_ai.tool.call.result for captured, successful MCP tool results. Register the 15 flattened tool-result fields already emitted by the JavaScript SDK as deprecated compatibility definitions, with guidance to use that canonical attribute. These definitions document legacy data; they are not a new recommended result format.

The two indexed prompt-result fields remain non-deprecated: they describe prompts/get, so gen_ai.tool.call.result is not their replacement.

Concern Before After this PR
Legacy tool results Seven singleton and eight indexed fields, such as mcp.tool.result.<key>.content, are emitted by the SDK but missing from conventions. All 15 are registered and marked deprecated. New capture is directed to gen_ai.tool.call.result.
Prompt results Indexed mcp.prompt.result.<key>.role and .content are missing from conventions. Both are registered as current attributes.

SDK capture

SDK #25060 adds the canonical output as one serialized JSON value containing content and, when present, structuredContent. For example, a successful result with two text blocks is captured as:

{
  "content": [
    { "type": "text", "text": "First item" },
    { "type": "text", "text": "Second item" }
  ]
}

That object is serialized into gen_ai.tool.call.result, rather than requiring consumers to assemble mcp.tool.result.0.content and mcp.tool.result.1.content. The SDK change respects output-capture settings and its size limit, and retains legacy fields during the transition. SDK #25059 handles shared constant imports. This conventions PR changes registry metadata; it does not change SDK emission.

Deprecation without backfill

The 15 deprecations use _status: null and recommend gen_ai.tool.call.result in reason. They have no replacement or aliases: a partial field cannot be copied into the complete result, and replacement would redirect search resolution even without ingestion backfill. Attribute and search key chains stay independent. The existing singleton mcp.tool.result.content backfill is unchanged.

This follows the MCP content-count deprecation #669 and the non-equivalent alternatives for http.target #587. The canonical capture target follows the OpenTelemetry MCP conventions.

Definitions preserve existing capture conditions and string scrubbing. The CLI treats only a trailing .<key> as a dynamic suffix, allowing the indexed legacy fields to generate valid constants. Generated JavaScript, Python, and search metadata are included.

Validation: yarn generate, yarn test (10,206 JavaScript and 12 Python tests), yarn lint (including type checks), yarn build, and yarn docs:build pass locally. Regression coverage checks all 15 deprecations, independent ingestion/search keys, both non-deprecated prompt fields, existing singleton backfill, and scrubbing.

PR Checklist

  • I have run yarn test and verified that the tests pass.
  • I have run yarn generate to generate and format code and docs.

If an attribute was added:

  • The attribute is in a namespace (e.g. nextjs.function_id, not function_id)
  • I have used the correct value for apply_scrubbing (i.e. manual or auto. Use never only for values that should never be scrubbed such as IDs)

If an attribute was deprecated:

  • I've followed the policies described in CONTRIBUTING.md: these are semantic deprecations without direct replacements or backfill, as explained above.

@vercel

vercel Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
sentry-conventions Ready Ready Preview Oct 9, 2026 8:38am UTC

Request Review

@github-actions

github-actions Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Semver Impact of This PR

🟡 Minor (new features)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


New Features ✨

Attributes

  • Deprecate legacy MCP tool result fields by betegon in #689
  • Align MCP conventions and OAuth client identity by betegon in #671
  • Add AWS service instrumentation attributes by pabloDeputter in #672
  • Add gen_ai memory conventions by ArthurKnaus in #653

Other

  • (model) Add metric model by giortzisg in #649
  • Add enum_values entries to shorten attribute briefs by alexander-alderman-webb in #685

Bug Fixes 🐛

Attributes

  • Add search_alias to sentry.link.type attribute by Lms24 in #687
  • Remove any as valid attribute type by Lms24 in #677

Documentation 📚

  • (contributing) Document process for fixing a misnamed attribute by sentry-junior in #673

Internal Changes 🔧

Deps

  • Bump sharp from 0.35.4 to 0.35.5 by dependabot in #683
  • Bump source-map-js from 1.2.1 to 1.2.2 by dependabot in #675
  • Bump smol-toml from 1.8.0 to 1.9.0 by dependabot in #674
  • Bump postcss-selector-parser from 7.1.4 to 7.1.6 by dependabot in #676

Other

  • (deps-dev) Bump oxfmt to 0.72.0 to pull in patched tinypool by Lms24 in #682
  • (docs) Add link preview meta tags by Lms24 in #667
  • (publish) Stop npm version from rewriting yarn.lock by Lms24 in #678
  • Add "evaluate" as a well-known value for gen_ai.operation.name by alexander-alderman-webb in #680
  • Deprecate mcp.tool.result.content_count by alexander-alderman-webb in #669

🤖 This preview updates automatically when you update the PR.

@alexander-alderman-webb alexander-alderman-webb left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are these attributes not deprecated in favor of gen_ai.tool.call.result?
They obviously have different semantics, but they can still be deprecated without backfill.

betegon commented Oct 8, 2026

Copy link
Copy Markdown
Member Author

right! thanks for the heads up. should be good now

@betegon betegon changed the title feat(attributes): register MCP result attribute families feat(attributes): deprecate legacy MCP tool result fields Oct 8, 2026
@betegon
betegon merged commit ec6ad67 into main Oct 9, 2026
18 checks passed
@betegon
betegon deleted the bt/mcp-result-conventions branch October 9, 2026 08:55

This branch was successfully deployed

1 active deployment
Preview — 0a3d42ae Deployed Oct 9, 2026 by vercel[bot]
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.

2 participants