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:
parent
e5dbdca65c
commit
39f9baab58
1 changed files with 4 additions and 0 deletions
|
|
@ -116,6 +116,8 @@ export interface TaskToolDefinition {
|
||||||
description: string;
|
description: string;
|
||||||
inputSchema?: ToolInputSchema;
|
inputSchema?: ToolInputSchema;
|
||||||
execution?: { taskSupport: "required" | "optional" };
|
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>;
|
handler: ToolTaskHandler<ToolInputSchema | undefined>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -482,6 +484,7 @@ export function createMcpServer(config: ServerConfig): McpServer {
|
||||||
description: tool.description,
|
description: tool.description,
|
||||||
inputSchema: tool.inputSchema,
|
inputSchema: tool.inputSchema,
|
||||||
execution: tool.execution,
|
execution: tool.execution,
|
||||||
|
...(tool._meta != null && { _meta: tool._meta }),
|
||||||
},
|
},
|
||||||
tool.handler,
|
tool.handler,
|
||||||
)
|
)
|
||||||
|
|
@ -490,6 +493,7 @@ export function createMcpServer(config: ServerConfig): McpServer {
|
||||||
{
|
{
|
||||||
description: tool.description,
|
description: tool.description,
|
||||||
execution: tool.execution,
|
execution: tool.execution,
|
||||||
|
...(tool._meta != null && { _meta: tool._meta }),
|
||||||
},
|
},
|
||||||
tool.handler,
|
tool.handler,
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue