MCPcopy Create free account
hub / github.com/Mnexa-AI/e2a / jsonRpcError

Function jsonRpcError

mcp/src/http-server.ts:355–366  ·  view source on GitHub ↗
(
  body: unknown,
  code: number,
  message: string,
)

Source from the content-addressed store, hash-verified

353}
354
355function jsonRpcError(
356 body: unknown,
357 code: number,
358 message: string,
359): Record<string, unknown> {
360 // Preserve the request id when we can identify it; otherwise null.
361 const id =
362 body && typeof body === "object" && "id" in body
363 ? (body as { id: unknown }).id
364 : null;
365 return { jsonrpc: "2.0", id, error: { code, message } };
366}
367
368/**
369 * Start the HTTP server on `port`. Returns a closer that stops the listener —

Callers 2

methodNotAllowedFunction · 0.85
handleClientRequestFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected