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

Function jsonRpcResponse

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

Source from the content-addressed store, hash-verified

239
240/** The envelope's own CORS-on JSON-RPC error `Response`, optionally carrying a challenge. */
241const jsonRpcResponse = (
242 status: number,
243 code: number,
244 message: string,
245 challenge?: string,
246): Response =>
247 challenge === undefined
248 ? jsonRpcErrorBody(status, code, message)
249 : jsonRpcErrorBody(status, code, message, { challenge });
250
251/**
252 * 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