Skip to content

Commit 39f9baa

Browse files
cliffhallclaude
andcommitted
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) <[email protected]> Claude-Session: https://claude.ai/code/session_01S3fTN8H3R8YV4yUGvZjYnX
1 parent e5dbdca commit 39f9baa

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

‎test-servers/src/composable-test-server.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,8 @@ export interface TaskToolDefinition {
116116
description: string;
117117
inputSchema?: ToolInputSchema;
118118
execution?: { taskSupport: "required" | "optional" };
119+
/** 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}. */
120+
_meta?: Record<string, unknown>;
119121
handler: ToolTaskHandler<ToolInputSchema | undefined>;
120122
}
121123

@@ -482,6 +484,7 @@ export function createMcpServer(config: ServerConfig): McpServer {
482484
description: tool.description,
483485
inputSchema: tool.inputSchema,
484486
execution: tool.execution,
487+
...(tool._meta != null && { _meta: tool._meta }),
485488
},
486489
tool.handler,
487490
)
@@ -490,6 +493,7 @@ export function createMcpServer(config: ServerConfig): McpServer {
490493
{
491494
description: tool.description,
492495
execution: tool.execution,
496+
...(tool._meta != null && { _meta: tool._meta }),
493497
},
494498
tool.handler,
495499
);

0 commit comments

Comments
 (0)