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

Method callTool

src/mcp/client/MCPClient.ts:155–165  ·  view source on GitHub ↗

* 调用工具

(sessionId: string, toolCall: MCPToolCall)

Source from the content-addressed store, hash-verified

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 服务器

Callers 1

handleCallToolMethod · 0.45

Calls 1

sendRequestMethod · 0.95

Tested by

no test coverage detected