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

Function renderDispatchError

packages/hosts/mcp/src/envelope.ts:172–175  ·  view source on GitHub ↗
(lookup: "not-found" | "forbidden")

Source from the content-addressed store, hash-verified

170
171/** Render a non-`Response` {@link McpDispatchResult} discriminant. */
172const renderDispatchError = (lookup: "not-found" | "forbidden"): Response =>
173 lookup === "not-found"
174 ? jsonRpcResponse(404, -32001, "Session not found")
175 : jsonRpcResponse(403, -32003, "MCP session does not belong to the current bearer");
176
177/** Dispatch an MCP request through authenticate -> store.dispatch -> transport. */
178const mcpDispatch = (resource: McpResource) =>

Callers 1

mcpDispatchFunction · 0.85

Calls 1

jsonRpcResponseFunction · 0.70

Tested by

no test coverage detected