Skip to content

Fix MCP tool display titles - #26046

Closed
uni-mike wants to merge 1 commit into
anomalyco:devfrom
uni-mike:fix-mcp-tool-display-title
Closed

uni-mike wants to merge 1 commit into
anomalyco:devfrom
uni-mike:fix-mcp-tool-display-title

Conversation

@uni-mike

@uni-mike uni-mike commented May 6, 2026

Copy link
Copy Markdown

Summary

  • Preserve MCP tool display titles from tools/list when converting MCP tools to AI SDK tools
  • Use the preserved title when completing MCP tool calls so CLI/TUI output does not show Unknown
  • Falls back to tool.title, then tool.annotations.title, then the MCP tool name

Motivation

OpenCode currently renders successful MCP calls as:

⚙ pekg_status Unknown

even when the MCP server returns:

{ "name": "status", "title": "PeKG Status", "annotations": { "title": "PeKG Status" } }

MCP tool definitions support title as the human-readable display name, so the completed tool part should use it instead of an empty title.

Fixes #26044.

Testing

  • Not run locally: this environment does not have bun installed, so bun run --cwd packages/opencode typecheck could not execute.
  • Patch is limited to preserving title metadata and using it in the existing MCP output object.

@github-actions

github-actions Bot commented May 6, 2026

Copy link
Copy Markdown
Contributor

Hey! Your PR title Fix MCP tool display titles doesn't follow conventional commit format.

Please update it to start with one of:

  • feat: or feat(scope): new feature
  • fix: or fix(scope): bug fix
  • docs: or docs(scope): documentation changes
  • chore: or chore(scope): maintenance tasks
  • refactor: or refactor(scope): code refactoring
  • test: or test(scope): adding or updating tests

Where scope is the package name (e.g., app, desktop, opencode).

See CONTRIBUTING.md for details.

@github-actions github-actions Bot added the needs:compliance This means the issue will auto-close after 2 hours. label May 6, 2026
@github-actions

github-actions Bot commented May 6, 2026

Copy link
Copy Markdown
Contributor

This PR doesn't fully meet our contributing guidelines and PR template.

What needs to be fixed:

  • PR description is missing required template sections. Please use the PR template.

Please edit this PR description to address the above within 2 hours, or it will be automatically closed.

If you believe this was flagged incorrectly, please let a maintainer know.

@github-actions

github-actions Bot commented May 6, 2026

Copy link
Copy Markdown
Contributor

This pull request has been automatically closed because it was not updated to meet our contributing guidelines within the 2-hour window.

Feel free to open a new pull request that follows our guidelines.

@github-actions github-actions Bot removed the needs:compliance This means the issue will auto-close after 2 hours. label May 6, 2026
@github-actions github-actions Bot closed this May 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MCP tool calls render Unknown despite tools/list title metadata

1 participant