From 18ce6e95c5c5c249e689e75ecc0e7a3828b1e5a8 Mon Sep 17 00:00:00 2001 From: jcro128 Date: Thu, 26 Mar 2026 23:17:18 -0700 Subject: [PATCH] Allow annotations to be set on custom MCP tools --- packages/plugin-mcp/src/mcp/getMcpHandler.ts | 1 + packages/plugin-mcp/src/types.ts | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/packages/plugin-mcp/src/mcp/getMcpHandler.ts b/packages/plugin-mcp/src/mcp/getMcpHandler.ts index 5e9ac74e7c5..47d1a5683f0 100644 --- a/packages/plugin-mcp/src/mcp/getMcpHandler.ts +++ b/packages/plugin-mcp/src/mcp/getMcpHandler.ts @@ -285,6 +285,7 @@ export const getMCPHandler = ( server.registerTool( tool.name, { + annotations: tool.annotations, description: tool.description, inputSchema: tool.parameters, }, diff --git a/packages/plugin-mcp/src/types.ts b/packages/plugin-mcp/src/types.ts index fcea1a2c186..bfd78b2d935 100644 --- a/packages/plugin-mcp/src/types.ts +++ b/packages/plugin-mcp/src/types.ts @@ -271,6 +271,16 @@ export type PluginMCPServerConfig = { * Add custom MCP Tools. */ tools?: { + /** + * Set the annotations of the tool. This is used by MCP clients to determine the behavior of the tool. + */ + annotations?: { + destructiveHint?: boolean + idempotentHint?: boolean + openWorldHint?: boolean + readOnlyHint?: boolean + title?: string + } /** * Set the description of the tool. This is used by MCP clients to determine when to use the tool. */