* Extracts the MCP server base URL for a tool by looking up its server connection. * Returns undefined for stdio servers, built-in tools, or if the server is not connected.
( toolName: string, mcpClients: MCPServerConnection[], )
| 325 | * Returns undefined for stdio servers, built-in tools, or if the server is not connected. |
| 326 | */ |
| 327 | function getMcpServerBaseUrlFromToolName( |
| 328 | toolName: string, |
| 329 | mcpClients: MCPServerConnection[], |
| 330 | ): string | undefined { |
| 331 | const serverConnection = findMcpServerConnection(toolName, mcpClients) |
| 332 | if (serverConnection?.type !== 'connected') { |
| 333 | return undefined |
| 334 | } |
| 335 | return getLoggingSafeMcpBaseUrl(serverConnection.config) |
| 336 | } |
| 337 | |
| 338 | export async function* runToolUse( |
| 339 | toolUse: ToolUseBlock, |
no test coverage detected