* 处理列出工具
(clientId: string, message: MCPMessage)
| 283 | * 处理列出工具 |
| 284 | */ |
| 285 | private async handleListTools(clientId: string, message: MCPMessage): Promise<void> { |
| 286 | const bladeTools = this.toolManager.getTools(); |
| 287 | |
| 288 | const tools: MCPTool[] = bladeTools.map((tool: any) => ({ |
| 289 | name: tool.name, |
| 290 | description: tool.description, |
| 291 | inputSchema: { |
| 292 | type: 'object', |
| 293 | properties: tool.parameters || {}, |
| 294 | required: tool.required || [], |
| 295 | }, |
| 296 | })); |
| 297 | |
| 298 | this.sendResponse(clientId, message.id, { tools }); |
| 299 | } |
| 300 | |
| 301 | /** |
| 302 | * 处理工具调用 |
no test coverage detected