build_graph
Build a Lachesis graph from any source directory, attach it, and make code navigation ready for the next call. Cached trees return instantly; use refresh to force rebuild and timeout_seconds for large repos.
Instructions
Build a Lachesis graph from a source directory and attach it — the zero-config way to start on a repo that has no graph yet, no separate lachesis-analyze step needed. Content-addressed: an unchanged tree returns instantly from cache; pass refresh=true to force a rebuild. On success the new graph is loaded, so the next tool call reasons over it. Toolchain: Python needs nothing extra; TypeScript/JavaScript need node on PATH and C needs clang — a missing one comes back as an actionable 'missing toolchain prerequisite' error, not a crash. Builds run in-process and can take minutes on a large tree (capped by timeout_seconds, default 300); a build longer than the MCP client's own request timeout may need a smaller subtree or an out-of-band lachesis-analyze.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| format | No | text (compact, default) | json (structured result page) | |
| source | Yes | path to the source directory to analyse | |
| refresh | No | force a rebuild even if the cached graph is current | |
| timeout_seconds | No | per-build compile timeout; raise for large trees |