MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / registerTool

Function registerTool

packages/hosts/mcp/src/tool-server.ts:435–446  ·  view source on GitHub ↗
(
    name,
    toolConfig,
    callback,
  )

Source from the content-addressed store, hash-verified

433 );
434
435 const registerTool: ExecutorMcpAssembly<McpServer, McpServerRequestContext>["registerTool"] = (
436 name,
437 toolConfig,
438 callback,
439 ) => {
440 const inputSchema = z.object(toolConfig.inputSchema);
441 return server.registerTool<z.ZodObject<z.ZodRawShape>, typeof inputSchema>(
442 name,
443 { ...toolConfig, inputSchema },
444 async (args, context) => toolResult(await callback(args, requestJoinKeys(context))),
445 );
446 };
447
448 const registerApp: ExecutorMcpAssembly<McpServer, McpServerRequestContext>["registerAppTool"] = (
449 name,

Callers

nothing calls this directly

Calls 3

toolResultFunction · 0.85
callbackFunction · 0.85
requestJoinKeysFunction · 0.85

Tested by

no test coverage detected