Add tool annotations to all Everything server tools

Previously only get-annotated-message had ToolAnnotations. Now all 18
tools explicitly declare readOnlyHint, destructiveHint, idempotentHint,
and openWorldHint so the server serves as a complete reference for
developers implementing tool annotations per the MCP spec.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
olaservo 2026-02-06 05:35:51 -07:00
commit baf99300a2
17 changed files with 102 additions and 0 deletions

View file

@ -13,6 +13,12 @@ const config = {
title: "Echo Tool", title: "Echo Tool",
description: "Echoes back the input string", description: "Echoes back the input string",
inputSchema: EchoSchema, inputSchema: EchoSchema,
annotations: {
readOnlyHint: true,
destructiveHint: false,
idempotentHint: true,
openWorldHint: false,
},
}; };
/** /**

View file

@ -8,6 +8,12 @@ const config = {
description: description:
"Returns all environment variables, helpful for debugging MCP server configuration", "Returns all environment variables, helpful for debugging MCP server configuration",
inputSchema: {}, inputSchema: {},
annotations: {
readOnlyHint: true,
destructiveHint: false,
idempotentHint: true,
openWorldHint: false,
},
}; };
/** /**

View file

@ -25,6 +25,12 @@ const config = {
description: description:
"Returns up to ten resource links that reference different types of resources", "Returns up to ten resource links that reference different types of resources",
inputSchema: GetResourceLinksSchema, inputSchema: GetResourceLinksSchema,
annotations: {
readOnlyHint: true,
destructiveHint: false,
idempotentHint: true,
openWorldHint: false,
},
}; };
/** /**

View file

@ -28,6 +28,12 @@ const config = {
title: "Get Resource Reference Tool", title: "Get Resource Reference Tool",
description: "Returns a resource reference that can be used by MCP clients", description: "Returns a resource reference that can be used by MCP clients",
inputSchema: GetResourceReferenceSchema, inputSchema: GetResourceReferenceSchema,
annotations: {
readOnlyHint: true,
destructiveHint: false,
idempotentHint: true,
openWorldHint: false,
},
}; };
/** /**

View file

@ -9,6 +9,12 @@ const config = {
description: description:
"Lists the current MCP roots provided by the client. Demonstrates the roots protocol capability even though this server doesn't access files.", "Lists the current MCP roots provided by the client. Demonstrates the roots protocol capability even though this server doesn't access files.",
inputSchema: {}, inputSchema: {},
annotations: {
readOnlyHint: true,
destructiveHint: false,
idempotentHint: true,
openWorldHint: false,
},
}; };
/** /**

View file

@ -27,6 +27,12 @@ const config = {
"Returns structured content along with an output schema for client data validation", "Returns structured content along with an output schema for client data validation",
inputSchema: GetStructuredContentInputSchema, inputSchema: GetStructuredContentInputSchema,
outputSchema: GetStructuredContentOutputSchema, outputSchema: GetStructuredContentOutputSchema,
annotations: {
readOnlyHint: true,
destructiveHint: false,
idempotentHint: true,
openWorldHint: false,
},
}; };
/** /**

View file

@ -14,6 +14,12 @@ const config = {
title: "Get Sum Tool", title: "Get Sum Tool",
description: "Returns the sum of two numbers", description: "Returns the sum of two numbers",
inputSchema: GetSumSchema, inputSchema: GetSumSchema,
annotations: {
readOnlyHint: true,
destructiveHint: false,
idempotentHint: true,
openWorldHint: false,
},
}; };
/** /**

View file

@ -11,6 +11,12 @@ const config = {
title: "Get Tiny Image Tool", title: "Get Tiny Image Tool",
description: "Returns a tiny MCP logo image.", description: "Returns a tiny MCP logo image.",
inputSchema: {}, inputSchema: {},
annotations: {
readOnlyHint: true,
destructiveHint: false,
idempotentHint: true,
openWorldHint: false,
},
}; };
/** /**

View file

@ -48,6 +48,12 @@ const config = {
description: description:
"Compresses a single file using gzip compression. Depending upon the selected output type, returns either the compressed data as a gzipped resource or a resource link, allowing it to be downloaded in a subsequent request during the current session.", "Compresses a single file using gzip compression. Depending upon the selected output type, returns either the compressed data as a gzipped resource or a resource link, allowing it to be downloaded in a subsequent request during the current session.",
inputSchema: GZipFileAsResourceSchema, inputSchema: GZipFileAsResourceSchema,
annotations: {
readOnlyHint: false,
destructiveHint: false,
idempotentHint: true,
openWorldHint: true,
},
}; };
/** /**

View file

@ -255,6 +255,12 @@ export const registerSimulateResearchQueryTool = (server: McpServer) => {
"If 'ambiguous' is true and client supports elicitation, sends an elicitation request for clarification.", "If 'ambiguous' is true and client supports elicitation, sends an elicitation request for clarification.",
inputSchema: SimulateResearchQuerySchema, inputSchema: SimulateResearchQuerySchema,
execution: { taskSupport: "required" }, execution: { taskSupport: "required" },
annotations: {
readOnlyHint: false,
destructiveHint: false,
idempotentHint: false,
openWorldHint: false,
},
}, },
{ {
/** /**

View file

@ -11,6 +11,12 @@ const config = {
title: "Toggle Simulated Logging", title: "Toggle Simulated Logging",
description: "Toggles simulated, random-leveled logging on or off.", description: "Toggles simulated, random-leveled logging on or off.",
inputSchema: {}, inputSchema: {},
annotations: {
readOnlyHint: false,
destructiveHint: false,
idempotentHint: false,
openWorldHint: false,
},
}; };
// Track enabled clients by session id // Track enabled clients by session id

View file

@ -11,6 +11,12 @@ const config = {
title: "Toggle Subscriber Updates", title: "Toggle Subscriber Updates",
description: "Toggles simulated resource subscription updates on or off.", description: "Toggles simulated resource subscription updates on or off.",
inputSchema: {}, inputSchema: {},
annotations: {
readOnlyHint: false,
destructiveHint: false,
idempotentHint: false,
openWorldHint: false,
},
}; };
// Track enabled clients by session id // Track enabled clients by session id

View file

@ -11,6 +11,12 @@ const config = {
"Demonstrates bidirectional MCP tasks where the server sends an elicitation request and " + "Demonstrates bidirectional MCP tasks where the server sends an elicitation request and " +
"the client handles user input asynchronously, allowing the server to poll for completion.", "the client handles user input asynchronously, allowing the server to poll for completion.",
inputSchema: {}, inputSchema: {},
annotations: {
readOnlyHint: false,
destructiveHint: false,
idempotentHint: false,
openWorldHint: false,
},
}; };
// Poll interval in milliseconds // Poll interval in milliseconds

View file

@ -10,6 +10,12 @@ const config = {
title: "Trigger Elicitation Request Tool", title: "Trigger Elicitation Request Tool",
description: "Trigger a Request from the Server for User Elicitation", description: "Trigger a Request from the Server for User Elicitation",
inputSchema: {}, inputSchema: {},
annotations: {
readOnlyHint: false,
destructiveHint: false,
idempotentHint: false,
openWorldHint: false,
},
}; };
/** /**

View file

@ -17,6 +17,12 @@ const config = {
title: "Trigger Long Running Operation Tool", title: "Trigger Long Running Operation Tool",
description: "Demonstrates a long running operation with progress updates.", description: "Demonstrates a long running operation with progress updates.",
inputSchema: TriggerLongRunningOperationSchema, inputSchema: TriggerLongRunningOperationSchema,
annotations: {
readOnlyHint: true,
destructiveHint: false,
idempotentHint: true,
openWorldHint: false,
},
}; };
/** /**

View file

@ -23,6 +23,12 @@ const config = {
"Demonstrates bidirectional MCP tasks where the server sends a request and the client " + "Demonstrates bidirectional MCP tasks where the server sends a request and the client " +
"executes it asynchronously, allowing the server to poll for progress and results.", "executes it asynchronously, allowing the server to poll for progress and results.",
inputSchema: TriggerSamplingRequestAsyncSchema, inputSchema: TriggerSamplingRequestAsyncSchema,
annotations: {
readOnlyHint: false,
destructiveHint: false,
idempotentHint: false,
openWorldHint: true,
},
}; };
// Poll interval in milliseconds // Poll interval in milliseconds

View file

@ -21,6 +21,12 @@ const config = {
title: "Trigger Sampling Request Tool", title: "Trigger Sampling Request Tool",
description: "Trigger a Request from the Server for LLM Sampling", description: "Trigger a Request from the Server for LLM Sampling",
inputSchema: TriggerSamplingRequestSchema, inputSchema: TriggerSamplingRequestSchema,
annotations: {
readOnlyHint: false,
destructiveHint: false,
idempotentHint: false,
openWorldHint: true,
},
}; };
/** /**