(entry: McpToolManifestEntry)
| 537 | * plugin-side store. Executor's `ToolDef` has no `_meta` field of its own, so |
| 538 | * the stamp is where a host reads it back. */ |
| 539 | const toToolDef = (entry: McpToolManifestEntry): ToolDef => { |
| 540 | const destructive = entry.annotations?.destructiveHint === true; |
| 541 | const stamp: McpToolStamp = { |
| 542 | toolName: entry.toolName, |
| 543 | ...(entry.annotations ? { upstream: entry.annotations } : {}), |
| 544 | ...(entry._meta ? { _meta: entry._meta } : {}), |
| 545 | }; |
| 546 | const annotations: StampedAnnotations = { |
| 547 | requiresApproval: destructive, |
| 548 | ...(destructive ? { approvalDescription: entry.annotations?.title ?? entry.toolName } : {}), |
| 549 | mcp: stamp, |
| 550 | }; |
| 551 | return { |
| 552 | name: ToolName.make(entry.toolId), |
| 553 | description: entry.description ?? `MCP tool: ${entry.toolName}`, |
| 554 | inputSchema: entry.inputSchema, |
| 555 | outputSchema: mcpCallToolResultOutputSchema(entry.outputSchema), |
| 556 | annotations: annotations as ToolAnnotations, |
| 557 | }; |
| 558 | }; |
| 559 | |
| 560 | const McpTextContent = Schema.Struct({ type: Schema.Literal("text"), text: Schema.String }); |
| 561 | const McpToolCallEnvelope = Schema.Struct({ |
nothing calls this directly
no test coverage detected