* 调用工具
(sessionId: string, toolCall: MCPToolCall)
| 153 | * 调用工具 |
| 154 | */ |
| 155 | async callTool(sessionId: string, toolCall: MCPToolCall): Promise<MCPToolResult> { |
| 156 | const response = await this.sendRequest(sessionId, { |
| 157 | method: 'tools/call', |
| 158 | params: { |
| 159 | name: toolCall.name, |
| 160 | arguments: toolCall.arguments, |
| 161 | }, |
| 162 | }); |
| 163 | |
| 164 | return response; |
| 165 | } |
| 166 | |
| 167 | /** |
| 168 | * 发送请求到 MCP 服务器 |
no test coverage detected