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

Function executeCodeAttrs

apps/cloud/src/mcp/telemetry.ts:148–161  ·  view source on GitHub ↗
(
  name: string | undefined,
  args: Record<string, unknown> | undefined,
)

Source from the content-addressed store, hash-verified

146const MAX_CODE_ATTR_CHARS = 10_000;
147
148const executeCodeAttrs = (
149 name: string | undefined,
150 args: Record<string, unknown> | undefined,
151): Record<string, unknown> => {
152 if (name !== "execute" && name !== "execute-action") return {};
153 const code = args?.["code"];
154 if (typeof code !== "string") return {};
155 return {
156 "mcp.execute.code":
157 code.length > MAX_CODE_ATTR_CHARS
158 ? `${code.slice(0, MAX_CODE_ATTR_CHARS)}\n… [truncated ${code.length - MAX_CODE_ATTR_CHARS} chars]`
159 : code,
160 };
161};
162
163const methodAttrs = (envelope: JsonRpcEnvelope): Record<string, unknown> => {
164 const params = envelope.params ?? {};

Callers 1

methodAttrsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected