Contents Menu Expand Light mode Dark mode Auto light/dark, in light mode Auto light/dark, in dark mode Skip to content
Axiom-Graph
Light Logo Dark Logo
Axiom-Graph
  • What is axiom-graph
    • Concepts
      • The Mesh
      • Node and Edge Types
      • DocJSON documents
      • Workflow annotations
      • Staleness
      • Change history, diffs, and reports
    • Get Started
      • Connect Your Agent
      • Use the CLI
      • Configuration
    • Pev
      • PEV Agent Nexus
    • Examples
      • Tutorial: The reporting pipeline, end to end
      • Tutorial: The docs-honesty loop
      • Tutorial: Render docs to a README, plugin docs and a site
      • Tutorial: Share a workflow and its code
    • The viz dashboard

Reference

  • CLI Reference
    • Indexing
    • Inspection
    • Rendering & site
  • MCP Tools
    • Search & navigate
      • axiom_graph_search
      • axiom_graph_source
      • axiom_graph_list
      • axiom_graph_graph
      • axiom_graph_render
      • axiom_graph_list_tags
      • axiom_graph_list_undocumented
      • axiom_graph_list_reference_points
      • axiom_graph_sql
    • Edit docs & links
      • axiom_graph_read_doc
      • axiom_graph_write_doc
      • axiom_graph_update_section
      • axiom_graph_patch_section
      • axiom_graph_add_section
      • axiom_graph_delete_section
      • axiom_graph_delete_doc
      • axiom_graph_update_doc_meta
      • axiom_graph_add_link
      • axiom_graph_delete_link
    • Staleness & lifecycle
      • axiom_graph_check
      • axiom_graph_drift_query
      • axiom_graph_mark_clean
      • axiom_graph_purge_node
      • axiom_graph_apply_rename
      • axiom_graph_revert_rename
    • History & impact
      • axiom_graph_history
      • axiom_graph_diff
      • axiom_graph_report
    • Build & workflows
      • axiom_graph_build
      • axiom_graph_checkout
      • axiom_graph_render_site
      • axiom_graph_workflow_list
      • axiom_graph_workflow_detail
      • axiom_graph_workflow_export
Back to top
View this page

axiom_graph_add_link¶

axiom_graph.mcp.server.axiom_graph_add_link(project_root, section_id='', node_id='', node_ids=None, links=None)¶

Link doc sections to the code nodes they describe, so drift flags them.

Loads the section’s JSON file, appends the link(s), writes the file back, and re-indexes once. When node_ids is provided, all links are added in a single pass with one re-index – much faster than calling this tool N times. links does the same across several sections of one doc.

Adding a link does not verify the section. A section whose links already holds an entry without a usable node id (a hand edit such as {"target": ...}) is refused with an ERROR naming the entry, and nothing is written; correct the entry first.

Parameters:
project_root str

Absolute path to the indexed project.

section_id str

Full qualified section ID, e.g. myproject::docs/architecture::database-layer.

node_id str

The code node ID to link to (single-link mode).

node_ids list[str] | None

List of code node IDs to link to (batch mode). When provided, node_id is ignored.

links list[dict] | None

Cross-section batch – list of {"section_id", "node_id"} items, all sections of one doc; one write and one re-index. Items spanning docs, or naming a missing section, fail the whole call and nothing is written. Leave section_id / node_id / node_ids unset when using it.

Return type:

str

Next
axiom_graph_delete_link
Previous
axiom_graph_update_doc_meta
Copyright © 2026, ddpoe
Made with Sphinx and @pradyunsg's Furo