Merge pull request #3246 from olaservo/fix/tool-annotations

feat(everything): add tool-level annotations to get-annotated-message
This commit is contained in:
Alex Akimov 2026-05-17 19:59:27 +02:00 • committed by GitHub
commit b1e1eb1a55
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
18 changed files with 121 additions and 4 deletions

View file

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

View file

@ -21,6 +21,12 @@ const config = {
description:
"Demonstrates how annotations can be used to provide metadata about content.",
inputSchema: GetAnnotatedMessageSchema,
annotations: {
readOnlyHint: true, // This tool only returns data, no side effects
destructiveHint: false, // Does not delete or modify anything
idempotentHint: true, // Same input always produces same output
openWorldHint: false, // Does not interact with external systems
},
};
/**

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -47,6 +47,12 @@ const config = {
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.",
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.",
inputSchema: SimulateResearchQuerySchema,
execution: { taskSupport: "required" },
annotations: {
readOnlyHint: false,
destructiveHint: false,
idempotentHint: false,
openWorldHint: false,
},
},
{
/**

View file

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

View file

@ -11,6 +11,12 @@ const config = {
title: "Toggle Subscriber Updates",
description: "Toggles simulated resource subscription updates on or off.",
inputSchema: {},
annotations: {
readOnlyHint: false,
destructiveHint: false,
idempotentHint: false,
openWorldHint: false,
},
};
// 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 " +
"the client handles user input asynchronously, allowing the server to poll for completion.",
inputSchema: {},
annotations: {
readOnlyHint: false,
destructiveHint: false,
idempotentHint: false,
openWorldHint: false,
},
};
// Poll interval in milliseconds

View file

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

View file

@ -17,6 +17,12 @@ const config = {
title: "Trigger Long Running Operation Tool",
description: "Demonstrates a long running operation with progress updates.",
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 " +
"executes it asynchronously, allowing the server to poll for progress and results.",
inputSchema: TriggerSamplingRequestAsyncSchema,
annotations: {
readOnlyHint: false,
destructiveHint: false,
idempotentHint: false,
openWorldHint: true,
},
};
// Poll interval in milliseconds

View file

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