(toolName: string, args: Record<string, unknown>, signal?: AbortSignal)
| 150 | } |
| 151 | |
| 152 | async callTool(toolName: string, args: Record<string, unknown>, signal?: AbortSignal): Promise<MCPToolResult> { |
| 153 | if (this.state !== 'ready') { |
| 154 | throw new Error(`MCP server ${this.name} is ${this.state}, cannot call tool`); |
| 155 | } |
| 156 | return this.requestWithTimeout<MCPToolResult>( |
| 157 | 'tools/call', |
| 158 | { name: toolName, arguments: args }, |
| 159 | 120_000, |
| 160 | signal, |
| 161 | ); |
| 162 | } |
| 163 | |
| 164 | // ---------- internals ---------- |
| 165 |
no test coverage detected