Skip to content

fix(mcp): annotate destructive and read-only tools - #17

Merged
BryanFRD merged 1 commit into
mainfrom
fix/13-tool-annotations
Oct 25, 2026
Merged

BryanFRD merged 1 commit into
mainfrom
fix/13-tool-annotations

Conversation

@BryanFRD

Copy link
Copy Markdown
Contributor

Registers get/list/search tools with readOnlyHint: true and the three delete tools with destructiveHint: true, so clients can gate them as the README describes. Adds a test covering every tool's annotations.

Closes #13

@ferrfleet-interne ferrfleet-interne Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The annotations are correct. The 13 read tools are the GET-only ones, and the 3 delete tools are the DELETE ones. The writes.test.ts mock change keeps resolving the handler as the last argument.

Nit: in the MCP spec, destructiveHint defaults to true whenever readOnlyHint is not true. So the unannotated create_* and plan_next_cycle tools still look destructive to clients, and { destructiveHint: true } on the deletes only states the default. The additive tools would benefit from { destructiveHint: false }, but annotations.test.ts ("marks no other tool destructive or read-only") currently forbids that. Consider loosening that assertion so a follow-up can do it.

Nit: the + 11 in "covers every registered tool" is a magic number. A named OTHER list of the write tools would make the test fail with a readable diff when a tool is added.

@BryanFRD
BryanFRD merged commit c7ffc8f into main Oct 25, 2026
15 of 16 checks passed
@BryanFRD
BryanFRD deleted the fix/13-tool-annotations branch October 25, 2026 10:39
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.

fix(mcp): annotate destructive and read-only tools

1 participant