MCPcopy Create free account
hub / github.com/Noumena-Network/code / getMcpServerBaseUrlFromToolName

Function getMcpServerBaseUrlFromToolName

src/services/tools/toolExecution.ts:327–336  ·  view source on GitHub ↗

* 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[],
)

Source from the content-addressed store, hash-verified

325 * Returns undefined for stdio servers, built-in tools, or if the server is not connected.
326 */
327function 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
338export async function* runToolUse(
339 toolUse: ToolUseBlock,

Callers 1

runToolUseFunction · 0.85

Calls 2

findMcpServerConnectionFunction · 0.85
getLoggingSafeMcpBaseUrlFunction · 0.85

Tested by

no test coverage detected