()
| 240 | } |
| 241 | |
| 242 | private async refreshTools(): Promise<void> { |
| 243 | try { |
| 244 | const r = await this.requestWithTimeout<{ tools: MCPToolDef[] }>('tools/list', {}, 5000); |
| 245 | this.tools = r.tools ?? []; |
| 246 | this.emit('tools-changed', this.tools); |
| 247 | } catch (e: any) { |
| 248 | logger.warn(`MCP ${this.name} refreshTools failed`, { err: e.message }); |
| 249 | } |
| 250 | } |
| 251 | |
| 252 | private requestWithTimeout<T>( |
| 253 | method: string, |
no test coverage detected