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

Function jsonRpcResponse

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

Source from the content-addressed store, hash-verified

137
138/** The envelope's own CORS-on JSON-RPC error `Response`, optionally carrying a challenge. */
139const jsonRpcResponse = (
140 status: number,
141 code: number,
142 message: string,
143 challenge?: string,
144): Response =>
145 challenge === undefined
146 ? jsonRpcErrorBody(status, code, message)
147 : jsonRpcErrorBody(status, code, message, { challenge });
148
149/**
150 * 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