Skip to Content
Context Graph10. Use it from an agent

Use it from an agent

By the end of this page an agent will be able to answer questions about your codebase, and you will know where that stops.

Prerequisites

The seven tools

Everything on the screens in this section is also available to an agent. Attach these from the tool picker — they need no configuration and no executor.

ToolWhat it answers
context_graph_appsWhich codebases are indexed, and at which commit. Start here.
context_graph_overviewA budgeted map of one codebase
context_graph_searchWhere something is handled, by meaning, with a repo/path:start-end citation
context_graph_sliceWhat surrounds a node — callers, callees, reads, writes
context_graph_impactWhat breaks if this changes
context_graph_read_fileThe real source of a file at the analysed commit
context_graph_changesWhat changed between two indexed versions

Full parameter reference: Context Graph tools.

An agent's tool picker filtered to the Context Graph tools

Start with context_graph_apps

Every other tool takes an application_id, and can omit it only when the project has exactly one indexed codebase. More than one and the agent has to know which — so the first call establishes what exists and at what commit.

It is also how an agent qualifies an answer honestly: “as of commit abc123” rather than implying it read your code a moment ago.

The one thing to tell the agent

⚠️

The graph is pinned to an indexed commit. It does not see uncommitted work, and it does not see anything merged since the last ingest. An agent that assumes otherwise will confidently describe code that has already been replaced.

Say so in the agent’s instructions. Something like:

The Context Graph reflects the last ingest, not the current branch. Call context_graph_apps first and state which commit your answer is based on. If the user is asking about work in progress, say that you cannot see it.

When to use the code tools instead

The two families are complementary, and the split is clean:

You want to…Use
Find where something is handled, understand it, judge a change’s blast radiusContext Graph
Change a file, run a build, commit, open a pull requestCode tools

The Context Graph needs no clone and no executor. The code tools need both, but they see the live working copy — including edits the agent has made, which the graph cannot.

Common issues

  • The agent says nothing is indexed — context_graph_apps returned empty. Run an ingest.
  • The agent asks which application — The project has more than one. Name it in the agent’s instructions, or let the agent call context_graph_apps first.
  • The agent describes code that no longer exists — The graph is pinned to the last ingest. Re-ingest, and add the instruction above.
  • The agent tries to edit a file and fails — Context Graph tools are read-only. It needs the code tools for that.