axiom_graph_write_doc¶
- axiom_graph.mcp.server.axiom_graph_write_doc(project_root, doc_json)¶
Write a DocJSON documentation file and register it in the index.
Accepts a JSON string or dict describing a documentation document. The file is written under the project’s primary docs directory (the first entry of
[axiom_graph.scan].docs_dirsinaxiom-graph.toml, falling back todocs/) and immediately indexed.The ‘id’ field is a path-slug filename hint, NOT the canonical node id. The canonical node id is derived later by the indexer from the file’s path. Common mistake: passing the indexed node id back as input.
# ✅ correct — path-slug, supports subdirs {“id”: “pev/instances/my-instance”, …}
# ❌ wrong — node-id form (rejected with an error) {“id”: “axiom_graph::docs.pev.instances.my-instance”, …}
The ‘id’ field is stripped from the JSON before writing.
- Parameters:
- project_root str
Absolute path to the indexed project.
- doc_json str | dict
JSON string or dict with keys:
title,sections(required) and optionallytags.
- Returns:
sections written, links registered, and any unknown node_ids. Or an
ERROR: ...string when validation fails.- Return type:
Summary