Add MCP tool annotations (readOnlyHint/destructiveHint/idempotentHint) for enterprise auto-approval policies #298
chrisfriedline-benchling
started this conversation in
Ideas
Replies: 1 comment 1 reply
-
|
TIL that tool annotations for indicating idempotency/destructiveness are a thing! I'm actually in the middle of some tool annotation changes as we speak, so I think I can take this on as part of that work. Thanks for the tip @chrisfriedline-benchling ! |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Right now the built-in MCP server (
/mcp/) registers all its tools with no annotations. That means enterprise MCP client policies (Claude Code, Claude Desktop team policies, etc) that auto-approve tool calls based on the standard MCP tool annotations (readOnlyHint,destructiveHint,idempotentHint,openWorldHint) can't do that here. Every call needs manual approval, even safe read-only ones likevault_listorvault_read.Want to propose annotating all 16 built-in tools with accurate hints:
vault_list,vault_read,vault_get_document_map,search_query,search_simple,tag_list,command_list,active_file_get_path→readOnlyHint: truevault_write,vault_patch,vault_delete,vault_move,command_execute→destructiveHint: truevault_append,periodic_note_get_path,open_file→ non-destructive write hints (idempotentHintset onperiodic_note_get_pathandopen_file, since a repeat call is a no-op)openWorldHint: falseacross the board, since none of these leave the local vaultHave a working implementation with passing tests locally, happy to open a PR if this is a direction y'all want.
One thing worth flagging first:
vault_patchsupportsappend/prepend/replace, but annotations are static per-tool (set once at registration, not per-call), so I annotated the whole tool asdestructiveHint: trueto cover thereplacecase, even thoughappend/prependaren't destructive. Curious whether you'd rather keep that as one conservative annotation, or splitvault_patchinto per-operation tools for tighter auto-approval behavior.Beta Was this translation helpful? Give feedback.
All reactions