MCPcopy Create free account
hub / github.com/echoVic/blade-code / handleListTools

Method handleListTools

src/mcp/server/MCPServer.ts:285–299  ·  view source on GitHub ↗

* 处理列出工具

(clientId: string, message: MCPMessage)

Source from the content-addressed store, hash-verified

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 * 处理工具调用

Callers 1

handleMessageMethod · 0.95

Calls 2

sendResponseMethod · 0.95
getToolsMethod · 0.45

Tested by

no test coverage detected