CodeGraph: codegraph_node
codegraph_nodeRead a source file with line numbers and dependents, or inspect a symbol's definition, signature, and callers/callees to identify what changes could break.
Instructions
Two modes. (1) READ A FILE — use INSTEAD of the Read tool: pass file (a path or basename) with no symbol and it returns that file's current on-disk source with line numbers, exactly the shape Read gives you (<n>\t<line>, safe to Edit from), narrowable with offset/limit just like Read — PLUS a one-line note of which files depend on it. Same bytes as Read, faster (served from the index), with the blast radius attached. Use it whenever you would Read a source file. (2) ONE SYMBOL you can name — its location, signature, verbatim source (includeCode=true) and caller/callee trail in one call, so before changing it you see what calls it and what your edit would break. For an AMBIGUOUS name it returns EVERY matching definition's body in one call (so you never Read a file to find the right overload); pass file/line to pin one. Use codegraph_explore for several related symbols or the full flow.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file | No | A file path or basename (e.g. "harness.rs", "src/auth/session.ts"). Pass it ALONE (no symbol) to READ the file like the Read tool — its full source with line numbers + which files depend on it. Or pass it WITH a symbol to disambiguate an overloaded name to the definition in this file. | |
| line | No | Symbol mode only: disambiguate to the definition at/around this line (use with the file:line a trail showed you). | |
| limit | No | File mode: maximum number of lines to return, exactly like Read's limit. Defaults to the whole file (capped at 2000 lines, like Read). | |
| offset | No | File mode: 1-based line to start reading from, exactly like Read's offset. Defaults to the start of the file. | |
| symbol | No | Name of the symbol to read (symbol mode). Omit it and pass `file` alone to read a whole file like Read. | |
| includeCode | No | Symbol mode: include the symbol's full body (default: false). Ignored in file mode, which always returns source unless `symbolsOnly` is set. | |
| projectPath | Yes | Absolute path to the project to query (or any directory inside it) — codegraph uses the nearest .codegraph/ index at or above that path. Omit to use this session's default project. Pass it to query a second codebase, or when the server root has no index of its own (e.g. a monorepo where only sub-projects are indexed, so there is no default project). | |
| symbolsOnly | No | File mode: return just the file's symbol map + dependents (a cheap structural overview) instead of its source. |