Skip to content

Pass client-only tool display metadata in MCP results - #306

Merged
timesler merged 3 commits into
mainfrom
feat/schema-tool-display-titles
Oct 31, 2026
Merged

timesler merged 3 commits into
mainfrom
feat/schema-tool-display-titles

Conversation

@timesler

@timesler timesler commented Oct 31, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Pass configured backend tool display titles to clients without adding them to model-facing content.

  • Preserve backend title/annotations through Rust discovery and binding DTOs.
  • Add _meta["atlassian.com/mcp-compressor/tool"] on both get_tool_schema and invoke_tool results, containing Tool-shaped metadata (name, resolved title, inputSchema, optional description/annotations).
  • Attach invocation metadata after shrinking, keeping it out of text previews and truncation artifacts. Preserve unrelated response metadata.
  • Display precedence: nonblank title → annotations.title → canonical name.
  • No title additions to content, structuredContent, compressed listings, or Python/TypeScript schema text. Callable identity and schemas unchanged.

_meta is the standard MCP envelope; the namespaced key is a compressor-specific extension. Hosts must consume this for UI only, not serialize protocol metadata into model history. Alta's companion implementation strips it before after-hooks/history and forwards validated titles as ACP tool_call_update events. Passthrough descriptors retain upstream metadata; no protocol can prevent an arbitrary host from serializing metadata it should not expose.

This supersedes the original text/structuredContent approach; PR was closed briefly and reopened at the requester's direction.

Validation

  • Rust: 341 core tests + 20 full compressed-server tests + 4 compression-level tests passed.
  • Real MCP wire tests at all four compression levels verify metadata on schema/invoke responses and absence of title sentinels in model-facing fields/listings. Existing complete-result preservation test verifies unrelated metadata remains intact.
  • TypeScript native rebuild + check: 127 passed with lint/format/typechecks.
  • Python native rebuild + core tests: 26 passed.
  • make check, docs-test, pre-commit hooks passed.

@timesler
timesler deployed to atlassian-mcp-integration October 31, 2026 00:40 — with GitHub Actions Active
@timesler
timesler marked this pull request as ready for review October 31, 2026 01:10
@timesler
timesler deployed to atlassian-mcp-integration October 31, 2026 01:10 — with GitHub Actions Active
@timesler

Copy link
Copy Markdown
Collaborator Author

Closing as requested: MCP tool display titles belong to tools/list descriptors. The compressed surface advertises wrapper tools, not upstream tools, so adding a separate schema-response title contract is not appropriate. This PR is withdrawn; no release is intended.

@timesler timesler closed this Oct 31, 2026
@timesler timesler reopened this Oct 31, 2026
@timesler
timesler deployed to atlassian-mcp-integration October 31, 2026 01:37 — with GitHub Actions Active
@timesler timesler changed the title Preserve tool display names in MCP schema lookup responses Pass client-only tool display metadata in MCP results Oct 31, 2026
@timesler

Copy link
Copy Markdown
Collaborator Author

Alta companion consumer: https://bitbucket.org/atlassian/alta/pull-requests/5314 — strips namespaced response metadata before after-hooks/model history and forwards validated UI titles over ACP, including durable approval resumes. No model-visible title additions.

@timesler
timesler deployed to atlassian-mcp-integration October 31, 2026 03:18 — with GitHub Actions Active
@timesler

Copy link
Copy Markdown
Collaborator Author

Fixed SDK v2 protocol CI in b9cbeb0. Reproduced all four failures: exact envelope expectations omitted the newly added client-only metadata. Updated the full expected envelope (without relaxing checks), added distinct UI-only title sentinels and assertions for schema/invoke content isolation under modern/legacy protocol modes and TOON on/off. Exact CI command now passes all 27 tests locally; make check, docs-test and commit hooks also pass. Replacement CI is running.

@timesler
timesler merged commit 7efc495 into main Oct 31, 2026
23 checks passed
@timesler
timesler deleted the feat/schema-tool-display-titles branch October 31, 2026 03:51

This branch was successfully deployed

1 active deployment
atlassian-mcp-integration — b9cbeb0f Deployed Oct 31, 2026 by timesler via atlassian-mcp-real-world #537
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.

1 participant