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

Function relationCounts

graph-ui/tools/handtest-fixes-galaxy.mjs:83–89  ·  view source on GitHub ↗

Die direkten Beziehungen eines Symbols nach Richtung und Art, als Wahrheit fuer K13.

(name)

Source from the content-addressed store, hash-verified

81
82/** Die direkten Beziehungen eines Symbols nach Richtung und Art, als Wahrheit fuer K13. */
83async function relationCounts(name) {
84 const count = async (pattern) => {
85 const answer = await tool('query_graph', { project: PROJECT, format: 'json', query: `MATCH ${pattern} WHERE n.name = "${name}" RETURN type(r) AS type, count(r) AS edges ORDER BY type` });
86 return Object.fromEntries((answer?.rows ?? []).map(([type, edges]) => [type, Number(edges)]));
87 };
88 return { incoming: await count('(a)-[r]->(n)'), outgoing: await count('(n)-[r]->(b)') };
89}
90
91/* ------------------------------------------------------------------ */
92/* In jede Seite */

Callers 2

checkK13Function · 0.85
checkK5Function · 0.85

Calls 1

countFunction · 0.70

Tested by

no test coverage detected