Skip to main content
Version: latest

Tools

The evidence tools search, read, and cite your documents. The task and decision tools record and read an agent's work. The built-in agent and the MCP server expose both groups under the names below, and Python exposes the evidence operations as functions in agrag.evidence.

Tool names​

The Python functions, the built-in agent, and the MCP server use the same name for each tool. The methods of TaskMemory and DecisionMemory have the names of the task and decision tools. A parameter has the same name on every surface, except where the agent or the server supplies the value itself.

Evidence tools​

OperationPython functionTool name
Passage searchsearch_evidencesearch_evidence
Fetch exact textfetch_evidencefetch_evidence
Document tree navigationnavigate_document_treenavigate_document_tree
Entity searchentity_searchentity_search
Relationship explorationexplore_relationshipsexplore_relationships
Citation checkcheck_citationscheck_citations
Numbered referencesrender_citationsnone. The agent formats its own answer, and fetch_evidence on the MCP server returns citation_markdown.
Source statussource_statusnone

Task and decision tools​

OperationTool nameOffered by
Read a taskget_taskAgent and MCP server
List task eventslist_eventsAgent and MCP server
Read one eventfetch_eventAgent and MCP server
List task stepslist_stepsAgent and MCP server
Search decisionssearch_decisionsAgent and MCP server
List conflicting decisionslist_conflictsMCP server only
Read a decisionget_decisionAgent and MCP server
List a decision's support historylist_support_historyAgent and MCP server
List a task's decisionslist_decisionsAgent and MCP server
List decisions that need reviewlist_decisions_for_reviewAgent and MCP server
Create a taskcreate_taskMCP server only. A run creates its task.
Record an eventrecord_eventMCP server only. The run records events.
Set a stepset_stepAgent and MCP server
Record a decisionrecord_decisionAgent and MCP server
Supersede a decisionsupersede_decisionAgent and MCP server
Reaffirm a decisionreaffirm_decisionAgent and MCP server
Continue review propagationcontinue_decision_reviewAgent and MCP server
Reject a decisionreject_decisionMCP server only. The agent cannot reject a human decision.

The agent works on one task in one project, and the caller fixes both. Its task tools therefore take no task_name, and its write tools take no request_id. On the MCP server, fetch_evidence takes max_chars, and set_step takes result_event_seq, the sequence number of an event that the client recorded. The agent passes result, the text of the result, to set_step and the run records the event.

Settings that turn tools on​

Tool groupBuilt-in agentMCP server
Evidence toolsOn. The scope argument of build_agent sets the readable documents.On. MCP_SCOPE_DOCUMENT_KEYS sets the readable documents.
Task and decision read toolsOn. build_agent sets the project and the agent.On when both MCP_PROJECT_ID and MCP_AGENT_ID are set.
Task and decision write toolsOn.On when the read conditions hold and MCP_READ_ONLY is false.
reject_decisionNot offered.On when the write conditions hold and MCP_ALLOW_REJECT is true.

The MCP server starts read-only. It refuses to start when write access is on and the project or the agent is missing. A tool call cannot widen the document scope or change the project.

Evidence tools​

Every evidence tool applies the document scope inside its queries. Retrieval lists the rules that all of them share.

Searches the text of current document versions in scope and returns ranked passages with evidence ids. Passage search describes the modes and the result.

ParameterTypeDefaultRange and notes
querystringrequiredPlain words. Query syntax has no effect.
modelexical, semantic, or hybridhybridhybrid runs both searches and fuses them.
limitintegeragent 8, MCP MCP_MAX_HITSAgent 1 to 50. MCP at least 1, capped at MCP_MAX_HITS. Python any positive integer.

Returns an EvidenceSearchResult with status, hits, truncated, index_state, and failures. A hit has evidence_id, document_key, title, content_hash, location, snippet, score, and legs.

Fetch​

Returns the exact stored text for evidence ids. Only a complete fetch makes an id citable. Fetch evidence describes the outcome and the statuses.

ParameterTypeDefaultRange and notes
evidence_idslist of stringsrequiredAt most 20 ids per call on the agent. On MCP, at most MCP_MAX_FETCH_IDS, default 20.
max_charsintegeragent max_result_characters, MCP MCP_MAX_FETCH_CHARSThe agent setting defaults to 12000. MCP accepts the argument and caps it at MCP_MAX_FETCH_CHARS, default 4000. Python requires the argument.

Returns one outcome for each id, in order. An outcome has status, text, title, uri, location, content_hash, status_of_version, partial, and citation_markdown.

Document tree navigation​

Returns passages near a known passage, in the same document version. Document tree navigation describes the six relations.

ParameterTypeDefaultRange and notes
evidence_idstringrequiredA chunk id or a span id.
relationparent, children, siblings, previous, next, or table_contextrequired
limitinteger101 to 50. The agent caps larger values at 50.
max_charsinteger120001 to 20000. The agent caps larger values at 20000.

Returns a NavigationResult with status, items, truncated, truncation_reason, version_status, and multi_section.

Finds entities by name or meaning, each with up to three mentioning passages. Entity search describes the search and the result.

ParameterTypeDefaultRange and notes
querystringrequiredMCP accepts 1 to 1000 characters.
labelslist of stringsall entity labelsMCP accepts up to 20 labels.
modelexical, semantic, or hybridhybridAs in passage search.
limitinteger101 to 50. MCP also caps it at MCP_MAX_HITS.

Python adds support_limit, the most passages listed for each entity, with a default of 3. Returns an EntityResult with status, hits, truncated, index_state, and failures. A hit has entity_id, label, name, properties, kind, score, legs, and support.

Relationship exploration​

Follows the relations around one entity. Explore relationships describes assertions, paths, and bounds.

ParameterTypeDefaultRange and notes
entity_idstringrequiredA canonical lowercase UUID from entity_search.
depthinteger11 or 2.
relation_typeslist of stringsall schema relation typesMCP accepts up to 20 types.
max_nodesinteger251 to 200.
max_edgesinteger501 to 200.

Returns an ExplorationResult with status, nodes, edges, truncated, truncated_by, and detail. An edge has source_id, target_id, relation_type, kind, and evidence.

Citation check​

Checks that cited evidence ids trace to text fetched in scope. Check citations describes the verdicts.

ParameterTypeDefaultRange and notes
evidence_idslist of stringsrequiredThe MCP server accepts at most MCP_MAX_FETCH_IDS ids.

Python takes the cited ids, the fetched ids, and the scope. It returns one verdict for each cited id. On MCP the check compares against the ids this server session fetched.

Task and decision tools​

The task and decision tools act on the configured project, and the document scope does not apply to them. Record decisions and review them describes the workflow, and Agent loop describes how the built-in agent uses them.

Read tools​

ToolReturnsUse it when
get_taskThe bounded resume view of a task, without event bodies.You resume a task or need its goal and progress.
list_eventsOne bounded page of a task's events after a sequence number.You need the order of messages, tool calls, and results.
fetch_eventOne event by task name and sequence number.You need the full body of one event.
list_stepsOne bounded page of steps in a given state, with a cursor.You need the completed, in-progress, or failed steps.
search_decisionsCurrent decisions in the project that can serve as precedents. The agent version leaves out decisions that need review or have non-current supports.A choice may already be covered by an earlier decision.
list_conflictsActive decisions of the same choice that reached different conclusions. MCP only.You look for disagreement across tasks.
get_decisionOne decision with its typed supports.You need one decision in full.
list_support_historyOne page of a decision's original and refreshed supports.You need to see why a decision was flagged.
list_decisionsA task's decisions, including superseded history.You review everything a task decided.
list_decisions_for_reviewDecisions flagged for review. The MCP tool can limit the list to one task.A source changed and you need the decisions that depend on it.

Write tools​

ToolEffectUse it when
create_taskCreates a task, or returns the existing record. A name with another goal returns task_exists. MCP only.A client starts work it wants to resume later.
record_eventAppends a bounded raw event. MCP only.A client keeps its own log in the task.
set_stepCreates or updates a named step. A completed step needs result text.You mark progress that a later run can reuse.
record_decisionRecords a decision with explicit support references. The same run or session must have fetched document evidence.A conclusion matters beyond the current answer.
supersede_decisionReplaces a decision with a new conclusion and keeps the history.New evidence changes a conclusion.
reaffirm_decisionReaffirms an active decision using current fetched document evidence.A flagged decision still holds after you read the current text.
continue_decision_reviewAdvances queued review propagation by a bounded amount. The MCP tool takes limit from 1 to 100, default 20.Review flags are still reaching dependent decisions.
reject_decisionRejects a decision and keeps the history. The MCP server offers it only when MCP_ALLOW_REJECT is true.A human reviewer overturns a decision.

The request-based MCP writes take a request_id, and a retry with the same id returns the saved result. The agent cannot rely on a decision marked needs_review or unknown.

Other limits​

LimitBuilt-in agentMCP server
Preview length of a hit240 charactersMCP_MAX_SNIPPET_CHARS, default 240
Size of one resultnoneMCP_MAX_RESPONSE_CHARS, default 60000
Time for each store readnoneMCP_REQUEST_DEADLINE_SECONDS, default 30
Tool calls in one runmax_tool_calls, default 20none
Steps in one runrecursion_limit, default 50none

An MCP result sets truncated when it left items out. Agent loop describes the agent settings, and the configuration reference lists the MCP variables.