Skip to content

fix(mcp): capture tool title in MCP client#1362

Merged
threepointone merged 2 commits intomainfrom
fix/mcp-client-capture-tool-title
Apr 23, 2026
Merged

fix(mcp): capture tool title in MCP client#1362
threepointone merged 2 commits intomainfrom
fix/mcp-client-capture-tool-title

Conversation

@threepointone
Copy link
Copy Markdown
Contributor

@threepointone threepointone commented Apr 23, 2026

Summary

  • Surface the MCP tool title on tools returned by MCPClientManager.getAITools(), so UIs can render the friendly title instead of the namespaced tool name.
  • Prefers the top-level tool.title (per the 2025-06-18 MCP spec) and falls back to the legacy tool.annotations?.title.
  • Mirrors the Vercel AI SDK fix in vercel/ai#11910.

Fixes #1360.

Notes

  • No type changes needed: the MCP SDK's Tool schema already declares both title and annotations.title, and ToolSet[string] in ai already accepts title?: string.

Test plan

  • Connect an MCP server that advertises a tool title (either top-level or via annotations.title) and verify title is present on the corresponding entry from getAITools().
  • Verify tools without a title still work (field is simply undefined).

Made with Cursor


Open in Devin Review

Surface the MCP tool title (top-level `title` per the 2025-06-18 spec,
falling back to the legacy `annotations.title`) on the tools returned
by `getAITools()`, so consumers can render the friendly title in UIs
rather than the namespaced tool name.

Fixes #1360.

Made-with: Cursor
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 23, 2026

⚠️ No Changeset found

Latest commit: 7ee397c

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 1 additional finding.

Open in Devin Review

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Apr 23, 2026

Open in StackBlitz

agents

npm i https://pkg.pr.new/agents@1362

@cloudflare/ai-chat

npm i https://pkg.pr.new/@cloudflare/ai-chat@1362

@cloudflare/codemode

npm i https://pkg.pr.new/@cloudflare/codemode@1362

hono-agents

npm i https://pkg.pr.new/hono-agents@1362

@cloudflare/shell

npm i https://pkg.pr.new/@cloudflare/shell@1362

@cloudflare/think

npm i https://pkg.pr.new/@cloudflare/think@1362

@cloudflare/voice

npm i https://pkg.pr.new/@cloudflare/voice@1362

@cloudflare/worker-bundler

npm i https://pkg.pr.new/@cloudflare/worker-bundler@1362

commit: 4ac7f3e

@threepointone threepointone merged commit d901804 into main Apr 23, 2026
2 checks passed
@threepointone threepointone deleted the fix/mcp-client-capture-tool-title branch April 23, 2026 03:18
@github-actions github-actions Bot mentioned this pull request Apr 23, 2026
@jer-k
Copy link
Copy Markdown

jer-k commented Apr 23, 2026

image

Works great, thank you!

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.

MCP Client doesn't capture title

2 participants