MCPcopy
hub / github.com/benjitaylor/agentation / sendJson

Function sendJson

mcp/src/server/http.ts:195–203  ·  view source on GitHub ↗

* Send JSON response.

(res: ServerResponse, status: number, data: unknown)

Source from the content-addressed store, hash-verified

193 * Send JSON response.
194 */
195function sendJson(res: ServerResponse, status: number, data: unknown): void {
196 res.writeHead(status, {
197 "Content-Type": "application/json",
198 "Access-Control-Allow-Origin": "*",
199 "Access-Control-Allow-Methods": "GET, POST, PATCH, DELETE, OPTIONS",
200 "Access-Control-Allow-Headers": "Content-Type",
201 });
202 res.end(JSON.stringify(data));
203}
204
205/**
206 * Send error response.

Callers 13

sendErrorFunction · 0.85
createSessionHandlerFunction · 0.85
listSessionsHandlerFunction · 0.85
getSessionHandlerFunction · 0.85
addAnnotationHandlerFunction · 0.85
updateAnnotationHandlerFunction · 0.85
getAnnotationHandlerFunction · 0.85
deleteAnnotationHandlerFunction · 0.85
getPendingHandlerFunction · 0.85
getAllPendingHandlerFunction · 0.85
requestActionHandlerFunction · 0.85
addThreadHandlerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…