MCPcopy Create free account
hub / github.com/MatterAIOrg/OrbCode / listServerTools

Function listServerTools

src/mcp/client.ts:105–114  ·  view source on GitHub ↗
(server: string, client: Client)

Source from the content-addressed store, hash-verified

103
104/** Enumerate tools from a connected client, namespaced as mcp__<server>__<tool>. */
105export async function listServerTools(server: string, client: Client): Promise<McpTool[]> {
106 const result = await client.listTools()
107 return (result.tools ?? []).map((tool) => ({
108 name: `mcp__${server}__${tool.name}`,
109 originalName: tool.name,
110 server,
111 description: tool.description,
112 inputSchema: (tool.inputSchema as Record<string, unknown>) ?? { type: "object", properties: {} },
113 }))
114}
115
116/** Call a tool on a connected client and return a text result for the model. */
117export async function callMcpTool(

Callers 1

connectMcpServerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected