feat(memory): add tool annotations to all 9 tools#3655
Open
owendevereaux wants to merge 1 commit intomodelcontextprotocol:mainfrom
Open
feat(memory): add tool annotations to all 9 tools#3655owendevereaux wants to merge 1 commit intomodelcontextprotocol:mainfrom
owendevereaux wants to merge 1 commit intomodelcontextprotocol:mainfrom
Conversation
Add readOnlyHint, destructiveHint, idempotentHint, and openWorldHint annotations to all tools in the memory server: Read-only tools (readOnlyHint: true, idempotentHint: true): - read_graph - search_nodes - open_nodes Write tools (readOnlyHint: false): - create_entities (not destructive, not idempotent) - create_relations (not destructive, not idempotent) - add_observations (not destructive, not idempotent) Destructive tools (destructiveHint: true): - delete_entities (not idempotent - cascade deletes relations) - delete_observations (not idempotent) - delete_relations (idempotent - deleting already-deleted is no-op) All tools have openWorldHint: false as the knowledge graph is local. Fixes modelcontextprotocol#3400
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add tool annotations to all 9 tools in the memory server, following the patterns established in server-filesystem.
Changes
Read-only tools (
readOnlyHint: true,idempotentHint: true)read_graph- reads entire knowledge graphsearch_nodes- searches for nodes by queryopen_nodes- retrieves specific nodes by nameWrite tools (
readOnlyHint: false,destructiveHint: false)create_entities- creates new entities (not idempotent - duplicates possible)create_relations- creates new relations (not idempotent)add_observations- adds observations to entities (not idempotent)Destructive tools (
destructiveHint: true)delete_entities- permanently deletes entities AND cascades to relations (idempotentHint: false)delete_observations- permanently removes observations (idempotentHint: false)delete_relations- removes graph edges (idempotentHint: true- deleting already-deleted is no-op)All tools have
openWorldHint: falseas the knowledge graph is local with no external network calls.Rationale
As noted in #3400, without annotations, clients have no way to differentiate risk levels between tools. The delete tools in particular perform permanent, cascading deletions with no undo -
destructiveHint: trueenables annotation-aware clients to add confirmation steps.This is a metadata-only change (~54 lines). No behavior changes.
Fixes #3400