From 39f9baab5871f746c1344f0b20ad5628945f59a3 Mon Sep 17 00:00:00 2001 From: cliffhall Date: Wed, 1 Jul 2026 19:18:59 -0400 Subject: [PATCH] test(test-servers): pass tool _meta through the task-tool registration path Address round-2 code-review note on PR #1587: the _meta passthrough was wired only into the regular registerTool path, so an App-flavored task tool would not surface tool-level _meta. Add _meta to TaskToolDefinition and a matching conditional spread on both registerToolTask overload configs so the two registration paths behave symmetrically. Co-Authored-By: Claude Opus 4.8 (1M context) Claude-Session: https://claude.ai/code/session_01S3fTN8H3R8YV4yUGvZjYnX --- test-servers/src/composable-test-server.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test-servers/src/composable-test-server.ts b/test-servers/src/composable-test-server.ts index 55ebb9a4..67bc7609 100644 --- a/test-servers/src/composable-test-server.ts +++ b/test-servers/src/composable-test-server.ts @@ -116,6 +116,8 @@ export interface TaskToolDefinition { description: string; inputSchema?: ToolInputSchema; execution?: { taskSupport: "required" | "optional" }; + /** Passed through to the SDK so clients can read tool-level `_meta` (e.g. `_meta.ui.resourceUri` for an App-flavored task tool). Mirrors {@link ToolDefinition._meta}. */ + _meta?: Record; handler: ToolTaskHandler; } @@ -482,6 +484,7 @@ export function createMcpServer(config: ServerConfig): McpServer { description: tool.description, inputSchema: tool.inputSchema, execution: tool.execution, + ...(tool._meta != null && { _meta: tool._meta }), }, tool.handler, ) @@ -490,6 +493,7 @@ export function createMcpServer(config: ServerConfig): McpServer { { description: tool.description, execution: tool.execution, + ...(tool._meta != null && { _meta: tool._meta }), }, tool.handler, );