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

Function invokeToolCode

e2e/scenarios/mcp-catalog-sync.test.ts:42–45  ·  view source on GitHub ↗
(slug: string, connection: string, tool: string, args: unknown)

Source from the content-addressed store, hash-verified

40// ToolResult envelope fields the assertions need. Tool failures are values in
41// the sandbox (`{ ok: false, error }`), not exceptions.
42const invokeToolCode = (slug: string, connection: string, tool: string, args: unknown) => `
43const result = await tools.${slug}.org.${connection}.${tool}(${JSON.stringify(args)});
44return { ok: result.ok, payload: result.ok ? result.data : result.error };
45`;
46
47type SandboxToolOutcome = {
48 readonly ok: boolean;

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected