Skip to main content

Module ctx_graph_primitives

Module ctx_graph_primitives 

Source
Expand description

Graph primitives for ctx_graph: neighbors, path (shortest path) and explain. These are graphify-style traversal/inspection helpers that work on the same file-level graph the dashboard renders (GraphProvider::edges), so the MCP answers and the visual graph always agree.

All three accept format="json" for machine consumption; otherwise they emit compact, token-light text with a [ctx_graph <action>: N tok] footer like the other actions.

Functionsยง

explain
ctx_graph action=explain โ€” why a file matters: degree, community, bridge score, god-node rank and its most important couplings. Reuses the same analyses the dashboard shows.
neighbors
ctx_graph action=neighbors โ€” immediate (and optionally multi-hop) graph neighbours of a file, split by direction and annotated with edge kind.
shortest_path
ctx_graph action=path โ€” shortest connection between two files, with the edge kind/direction of each hop.