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

Function rpcLabel

e2e/src/surfaces/mcp.ts:35–49  ·  view source on GitHub ↗
(body: unknown)

Source from the content-addressed store, hash-verified

33
34/** JSON-RPC body → a human label: tool name for tools/call, else method. */
35const rpcLabel = (body: unknown): string | undefined => {
36 if (typeof body !== "string") return undefined;
37 try {
38 const parsed = JSON.parse(body) as {
39 method?: string;
40 params?: { name?: string };
41 };
42 if (!parsed.method) return undefined;
43 return parsed.method === "tools/call" && parsed.params?.name
44 ? `${parsed.params.name}()`
45 : parsed.method;
46 } catch {
47 return undefined;
48 }
49};
50
51const installTraceparentFetch = (mcpUrl: string, runDir: string): void => {
52 traceSink = { mcpUrl, runDir };

Callers 1

finishFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected