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

Function jsonRpcResponse

packages/hosts/mcp/src/envelope.ts:123–131  ·  view source on GitHub ↗
(
  status: number,
  code: number,
  message: string,
  challenge?: string,
)

Source from the content-addressed store, hash-verified

121
122/** The envelope's own CORS-on JSON-RPC error `Response`, optionally carrying a challenge. */
123const jsonRpcResponse = (
124 status: number,
125 code: number,
126 message: string,
127 challenge?: string,
128): Response =>
129 challenge === undefined
130 ? jsonRpcErrorBody(status, code, message)
131 : jsonRpcErrorBody(status, code, message, { challenge });
132
133/**
134 * Reconstruct a WHATWG `Request` from the Effect HTTP request. Prefer the

Callers 4

renderAuthErrorFunction · 0.70
renderDispatchErrorFunction · 0.70
mcpDispatchFunction · 0.70
mcpRouteFunction · 0.70

Calls 1

jsonRpcErrorBodyFunction · 0.85

Tested by

no test coverage detected