feat(memory): add tool annotations to all knowledge graph tools (#3874)
Add MCP ToolAnnotations to all 9 tools in the memory server, matching the annotation coverage already present in server-filesystem, server-git, server-time, and server-sequential-thinking. - Read tools (read_graph, search_nodes, open_nodes): read-only, idempotent - Write tools (create_entities, create_relations, add_observations): non-destructive - Delete tools (delete_entities, delete_observations, delete_relations): destructive, idempotent - All tools: openWorldHint=false (local JSONL file operations only) Co-authored-by: Ola Hungerford <olahungerford@gmail.com>
This commit is contained in:
parent
9bade64fce
commit
64b1cb0208
1 changed files with 54 additions and 0 deletions
|
|
@ -269,6 +269,12 @@ server.registerTool(
|
||||||
},
|
},
|
||||||
outputSchema: {
|
outputSchema: {
|
||||||
entities: z.array(EntitySchema)
|
entities: z.array(EntitySchema)
|
||||||
|
},
|
||||||
|
annotations: {
|
||||||
|
readOnlyHint: false,
|
||||||
|
destructiveHint: false,
|
||||||
|
idempotentHint: false,
|
||||||
|
openWorldHint: false,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async ({ entities }) => {
|
async ({ entities }) => {
|
||||||
|
|
@ -291,6 +297,12 @@ server.registerTool(
|
||||||
},
|
},
|
||||||
outputSchema: {
|
outputSchema: {
|
||||||
relations: z.array(RelationSchema)
|
relations: z.array(RelationSchema)
|
||||||
|
},
|
||||||
|
annotations: {
|
||||||
|
readOnlyHint: false,
|
||||||
|
destructiveHint: false,
|
||||||
|
idempotentHint: false,
|
||||||
|
openWorldHint: false,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async ({ relations }) => {
|
async ({ relations }) => {
|
||||||
|
|
@ -319,6 +331,12 @@ server.registerTool(
|
||||||
entityName: z.string(),
|
entityName: z.string(),
|
||||||
addedObservations: z.array(z.string())
|
addedObservations: z.array(z.string())
|
||||||
}))
|
}))
|
||||||
|
},
|
||||||
|
annotations: {
|
||||||
|
readOnlyHint: false,
|
||||||
|
destructiveHint: false,
|
||||||
|
idempotentHint: false,
|
||||||
|
openWorldHint: false,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async ({ observations }) => {
|
async ({ observations }) => {
|
||||||
|
|
@ -342,6 +360,12 @@ server.registerTool(
|
||||||
outputSchema: {
|
outputSchema: {
|
||||||
success: z.boolean(),
|
success: z.boolean(),
|
||||||
message: z.string()
|
message: z.string()
|
||||||
|
},
|
||||||
|
annotations: {
|
||||||
|
readOnlyHint: false,
|
||||||
|
destructiveHint: true,
|
||||||
|
idempotentHint: true,
|
||||||
|
openWorldHint: false,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async ({ entityNames }) => {
|
async ({ entityNames }) => {
|
||||||
|
|
@ -368,6 +392,12 @@ server.registerTool(
|
||||||
outputSchema: {
|
outputSchema: {
|
||||||
success: z.boolean(),
|
success: z.boolean(),
|
||||||
message: z.string()
|
message: z.string()
|
||||||
|
},
|
||||||
|
annotations: {
|
||||||
|
readOnlyHint: false,
|
||||||
|
destructiveHint: true,
|
||||||
|
idempotentHint: true,
|
||||||
|
openWorldHint: false,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async ({ deletions }) => {
|
async ({ deletions }) => {
|
||||||
|
|
@ -391,6 +421,12 @@ server.registerTool(
|
||||||
outputSchema: {
|
outputSchema: {
|
||||||
success: z.boolean(),
|
success: z.boolean(),
|
||||||
message: z.string()
|
message: z.string()
|
||||||
|
},
|
||||||
|
annotations: {
|
||||||
|
readOnlyHint: false,
|
||||||
|
destructiveHint: true,
|
||||||
|
idempotentHint: true,
|
||||||
|
openWorldHint: false,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async ({ relations }) => {
|
async ({ relations }) => {
|
||||||
|
|
@ -412,6 +448,12 @@ server.registerTool(
|
||||||
outputSchema: {
|
outputSchema: {
|
||||||
entities: z.array(EntitySchema),
|
entities: z.array(EntitySchema),
|
||||||
relations: z.array(RelationSchema)
|
relations: z.array(RelationSchema)
|
||||||
|
},
|
||||||
|
annotations: {
|
||||||
|
readOnlyHint: true,
|
||||||
|
destructiveHint: false,
|
||||||
|
idempotentHint: true,
|
||||||
|
openWorldHint: false,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async () => {
|
async () => {
|
||||||
|
|
@ -435,6 +477,12 @@ server.registerTool(
|
||||||
outputSchema: {
|
outputSchema: {
|
||||||
entities: z.array(EntitySchema),
|
entities: z.array(EntitySchema),
|
||||||
relations: z.array(RelationSchema)
|
relations: z.array(RelationSchema)
|
||||||
|
},
|
||||||
|
annotations: {
|
||||||
|
readOnlyHint: true,
|
||||||
|
destructiveHint: false,
|
||||||
|
idempotentHint: true,
|
||||||
|
openWorldHint: false,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async ({ query }) => {
|
async ({ query }) => {
|
||||||
|
|
@ -458,6 +506,12 @@ server.registerTool(
|
||||||
outputSchema: {
|
outputSchema: {
|
||||||
entities: z.array(EntitySchema),
|
entities: z.array(EntitySchema),
|
||||||
relations: z.array(RelationSchema)
|
relations: z.array(RelationSchema)
|
||||||
|
},
|
||||||
|
annotations: {
|
||||||
|
readOnlyHint: true,
|
||||||
|
destructiveHint: false,
|
||||||
|
idempotentHint: true,
|
||||||
|
openWorldHint: false,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async ({ names }) => {
|
async ({ names }) => {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue