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

Function jsonRpcResponse

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

Source from the content-addressed store, hash-verified

169
170/** The envelope's own CORS-on JSON-RPC error `Response`, optionally carrying a challenge. */
171const jsonRpcResponse = (
172 status: number,
173 code: number,
174 message: string,
175 challenge?: string,
176): Response =>
177 challenge === undefined
178 ? jsonRpcErrorBody(status, code, message)
179 : jsonRpcErrorBody(status, code, message, { challenge });
180
181/**
182 * 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