* Build an MCP tool definition for `toServerTools`. The MCP-Apps `_meta.ui` * link is a custom extension not present in the SDK's base `Tool` schema, so * the assembled literal needs one cast to `McpToolDef` — centralized here * instead of scattering `as never` across each test def.
(def: {
name: string
description?: string
inputSchema?: { type: 'object'; properties?: Record<string, unknown> }
_meta?: { ui?: { resourceUri?: string } }
})
| 22 | * instead of scattering `as never` across each test def. |
| 23 | */ |
| 24 | function mcpToolDef(def: { |
| 25 | name: string |
| 26 | description?: string |
| 27 | inputSchema?: { type: 'object'; properties?: Record<string, unknown> } |
| 28 | _meta?: { ui?: { resourceUri?: string } } |
| 29 | }): McpToolDef { |
| 30 | return { |
| 31 | inputSchema: { type: 'object', properties: {} }, |
| 32 | ...def, |
| 33 | } as McpToolDef |
| 34 | } |
| 35 | |
| 36 | /** |
| 37 | * Build a fake MCP `Client` that only implements `callTool` — the single |