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

Function jsonRpcResponse

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

Source from the content-addressed store, hash-verified

108
109/** The envelope's own CORS-on JSON-RPC error `Response`, optionally carrying a challenge. */
110const jsonRpcResponse = (
111 status: number,
112 code: number,
113 message: string,
114 challenge?: string,
115): Response =>
116 challenge === undefined
117 ? jsonRpcErrorBody(status, code, message)
118 : jsonRpcErrorBody(status, code, message, { challenge });
119
120/**
121 * 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