MCPcopy
hub / github.com/claude-code-best/claude-code / callTool

Method callTool

packages/mcp-client/src/manager.ts:167–189  ·  view source on GitHub ↗
(
    serverName: string,
    toolName: string,
    args: unknown,
  )

Source from the content-addressed store, hash-verified

165 }
166
167 async callTool(
168 serverName: string,
169 toolName: string,
170 args: unknown,
171 ): Promise<unknown> {
172 const conn = this.connections.get(serverName)
173 if (!conn || conn.type !== 'connected') {
174 throw new McpConnectionError(
175 serverName,
176 `Server ${serverName} is not connected`,
177 )
178 }
179
180 return callMcpTool(
181 {
182 client: conn,
183 tool: toolName,
184 args: args as Record<string, unknown>,
185 signal: new AbortController().signal,
186 },
187 this.deps,
188 )
189 }
190
191 on<E extends keyof McpManagerEvents>(
192 event: E,

Callers

nothing calls this directly

Calls 2

callMcpToolFunction · 0.85
getMethod · 0.65

Tested by

no test coverage detected