axiom_graph_source

axiom_graph.mcp.server.axiom_graph_source(project_root, node_id='', node_ids=None, max_chars=40000)

Return the raw source body of a node, looked up by ID.

Uses the level_3_location stored in the index to locate the file and line range, then returns those source lines directly. This removes the need to manually read files after a axiom_graph_search – the full flow becomes axiom_graph_search -> axiom_graph_source.

For module-level nodes (no line range stored) the entire file is returned.

Parameters:
project_root str

Absolute path to the indexed project.

node_id str

Full node ID, e.g. myproject::pm.cli::some_function.

node_ids list[str] | None

Optional list of node IDs for batch operation. When provided, node_id is ignored and results are returned for all listed IDs with per-ID delimiters. Invalid IDs produce per-ID error messages without aborting the entire call.

max_chars int

Maximum total characters in the response (default 40 000). High enough that single-node calls are never truncated, but prevents batch calls from blowing up context. When the limit is hit mid-batch, remaining node IDs are listed so you can fetch them in a follow-up call. Pass None to disable the limit entirely.

Return type:

str