Skip to content

Carry MCP tool annotations through to the tool mapping - #2476

Merged
pngwn merged 1 commit into
mainfrom
feat/mcp-tool-annotations
Aug 3, 2026
Merged

Carry MCP tool annotations through to the tool mapping#2476
pngwn merged 1 commit into
mainfrom
feat/mcp-tool-annotations

Conversation

@pngwn

@pngwn pngwn commented Aug 3, 2026

Copy link
Copy Markdown
Member

tools/list returns per-tool behaviour hints — readOnlyHint, destructiveHint, idempotentHint, openWorldHint — and the listing discarded all of them, keeping only annotations.title as a description fallback. They are the natural input to an approval policy, which cannot be written until the data reaches it.

Hints now ride on McpToolMapping, next to the server and tool they belong to. Only real booleans are kept, so a server sending a truthy string cannot be read as having declared a hint, and they are deliberately not merged with the spec's defaults: a caller needs to tell "declared safe" from "said nothing", because an undeclared tool defaults to destructive, not safe.

Annotations stay out of the OpenAI tool definition — they are not part of the function schema and strict providers reject unknown fields.

`tools/list` returns per-tool behaviour hints — readOnlyHint, destructiveHint,
idempotentHint, openWorldHint — and the listing discarded all of them, keeping
only `annotations.title` as a description fallback. They are the natural input to
an approval policy, which cannot be written until the data reaches it.

Hints now ride on McpToolMapping, next to the server and tool they belong to.
Only real booleans are kept, so a server sending a truthy string cannot be read
as having declared a hint, and they are deliberately not merged with the spec's
defaults: a caller needs to tell "declared safe" from "said nothing", because an
undeclared tool defaults to destructive, not safe.

Annotations stay out of the OpenAI tool definition — they are not part of the
function schema and strict providers reject unknown fields.
@pngwn
pngwn merged commit 0f9f26b into main Aug 3, 2026
7 checks passed
@pngwn
pngwn deleted the feat/mcp-tool-annotations branch August 3, 2026 17:54
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