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) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01S3fTN8H3R8YV4yUGvZjYnX
This commit is contained in:
cliffhall 2026-07-01 19:18:59 -04:00
commit 39f9baab58

View file

@ -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<string, unknown>;
handler: ToolTaskHandler<ToolInputSchema | undefined>;
}
@ -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,
);