工具定义:name + 描述 + JSON Schema(不依赖 zod,手写 inputSchema)
| 43 | |
| 44 | /** 工具定义:name + 描述 + JSON Schema(不依赖 zod,手写 inputSchema) */ |
| 45 | interface ToolDef { |
| 46 | name: string |
| 47 | description: string |
| 48 | inputSchema: Record<string, any> |
| 49 | /** 是否高风险(用于审批策略默认值与提示) */ |
| 50 | risky?: boolean |
| 51 | handler: (args: Record<string, any>) => Promise<MCPToolResult> |
| 52 | } |
| 53 | |
| 54 | function resultText(result: MCPToolResult): string | undefined { |
| 55 | const parts = result?.content |
nothing calls this directly
no outgoing calls
no test coverage detected