MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / json

Function json

graph-ui/tools/pr-2068-errors-e2e.mjs:29–37  ·  view source on GitHub ↗
(path, body)

Source from the content-addressed store, hash-verified

27const saveReport = () => writeFile(join(OUT, `${proofPrefix}errors-e2e.json`), JSON.stringify(report, null, 2) + '\n');
28
29async function json(path, body) {
30 const response = await fetch(ORIGIN + path, { method: body ? 'POST' : 'GET', ...(body ? { headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(body) } : {}) });
31 const text = await response.text();
32 let payload;
33 try { payload = JSON.parse(text); } catch { payload = { raw: text }; }
34 report.directRequests.push({ at: new Date().toISOString(), method: body ? 'POST' : 'GET', path, status: response.status });
35 if (!response.ok) throw new Error(`${path}: HTTP ${response.status}: ${text.slice(0, 300)}`);
36 return payload;
37}
38
39async function rpc(name, args) {
40 const response = await json('/rpc', { jsonrpc: '2.0', id: ++rpcId, method: 'tools/call', params: { name, arguments: { ...args, format: 'json' } } });

Callers 3

rpcFunction · 0.70
indexFunction · 0.70
failedJobWhileWatchingFunction · 0.70

Calls 2

textMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected