Skip to main content
Version: 0.0.7 (stable)

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. ConversationHistory provides the task methods, and DecisionTraces provides the decision methods. 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
Theme searchsearch_themessearch_themes
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, except fetch_event and list_events, 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.

MCP server tools​

The MCP server registers the tools below. The last column shows whether the built-in agent offers the same tool. Four tools exist only on MCP: list_conflicts, create_task, record_event, and reject_decision.

ToolGroupOn the agentNotes
search_evidenceEvidenceYesPassage search.
fetch_evidenceEvidenceYesTakes max_chars.
check_citationsEvidenceYesCompares against the ids this server session fetched.
entity_searchEvidenceYes
explore_relationshipsEvidenceYes
navigate_document_treeEvidenceYes
search_themesEvidenceYes
get_taskTask readYesTakes task_name on MCP.
list_eventsTask readYes
fetch_eventTask readYes
list_stepsTask readYes
search_decisionsDecision readYesThe agent leaves out decisions that need review or have non-current supports.
list_conflictsDecision readNo, MCP only
get_decisionDecision readYes
list_support_historyDecision readYes
list_decisionsDecision readYesTakes task_name on MCP. The agent takes include_history instead.
list_decisions_for_reviewDecision readYesOn MCP, task_name is optional.
create_taskTask writeNo, MCP only
record_eventTask writeNo, MCP only
set_stepTask writeYesTakes result_event_seq on MCP.
record_decisionDecision writeYes
supersede_decisionDecision writeYes
reaffirm_decisionDecision writeYes
continue_decision_reviewDecision writeYes
reject_decisionDecision writeNo, MCP onlyRegistered only when MCP_ALLOW_REJECT is true.

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.
limitinteger10Agent 1 to 50. MCP at least 1, capped at MCP_MAX_HITS (default 10). 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 uses 4000 when the argument is omitted, and raises ValueError when it is not positive.

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. Larger values are rejected.
max_charsinteger120001 to 20000. Larger values are rejected.

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.

Finds themes, which are clusters of related entities from the last community detection run, each with the passages that mention its members. Theme search describes the search and the result.

ParameterTypeDefaultRange and notes
querystringrequiredMCP accepts 1 to 1000 characters. Matches by meaning only.
limitinteger51 to 10. MCP also caps it at MCP_MAX_HITS. Python any positive integer.
support_limitinteger31 to 10. The most passages listed for each theme. Python any positive integer.

Python takes these as keyword arguments of search_themes, and raises ValueError when limit or support_limit is not positive. Returns a ThemeResult with status, themes, truncated, index_state, and failures. A theme has theme_id, score, entities, which holds up to five member names, and passages.

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.

Source status​

Source status is not a tool on either surface. The Python function source_status in agrag.evidence reads it, and Graph.source_status(document_key) in agrag/ingestion/graph.py calls the same function with the graph's stores.

ParameterTypeDefaultRange and notes
document_keystringrequiredThe stable key of the source.
vector_storeVectorStoreNoneExternal vector store. None reads the graph-native indexes.
dimensionsintegerNoneExpected embedding dimension, checked against an external store.

Returns a SourceStatus with document_key, state, content_hash, activation_seq, version_id, job_id, job_status, lease_expires_at, job_age_seconds, job_error, and indexes. Each entry in indexes has name, state, and population_percent.

stateMeaning
currentThe committed version is complete and active.
pendingAn incomplete job holds a live lease.
failedThe latest job's lease has expired, or the committed version is incomplete.
deletedThe last committed change removed the source. content_hash is None.
unknownThe store has no record of this key.

An index state is the database state, such as ONLINE. It is MISSING when the store does not list the index.

Task and decision tools​

The task and decision tools act on the configured project, and the document scope does not apply to them. Use Decision traces to record supported decisions and review them. Agent loop describes how the built-in agent records and resumes task work.

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 of 1 to 64 characters, and a retry with the same id returns the saved result. The agent cannot rely on a decision marked needs_review or unknown.

Parameters​

The parameters below apply to the MCP server unless a note says otherwise. The agent uses the same names. Its bounds are noted where they differ, and its text fields have no length bound.

Read tools​

ToolParameterTypeDefaultRange and notes
get_tasktask_namestringrequired1 to 200 characters. The agent takes no task_name.
list_eventstask_namestringrequired1 to 200 characters.
list_eventsafter_seqinteger00 or more.
list_eventslimitinteger501 to 200. The agent allows 1 to 50.
fetch_eventtask_namestringrequired1 to 200 characters.
fetch_eventseqintegerrequired1 or more.
list_stepstask_namestringrequired1 to 200 characters. The agent takes no task_name.
list_stepsstatestringrequirednot_started, in_progress, completed, failed, or unknown.
list_stepsafter_namestringNoneContinuation cursor, at most 200 characters.
list_stepslimitinteger501 to 200. The agent allows 1 to 50.
search_decisionsquerystringrequired1 to 1000 characters.
search_decisionslimitinteger201 to 100, capped at MCP_MAX_HITS. The agent allows 1 to 20.
list_conflictsnoneNo parameters.
get_decisiondecision_idUUIDrequired
list_support_historydecision_idUUIDrequired
list_support_historyafter_ordinalinteger-1Starts after this ordinal.
list_support_historylimitinteger201 to 100. The agent allows 1 to 50.
list_decisionstask_namestringrequired1 to 200 characters. The agent takes include_history instead.
list_decisionsinclude_historybooleantrueAgent only. Set false to leave out superseded history.
list_decisions_for_reviewtask_namestringNone1 to 200 characters. Limits the list to one task. The agent takes no task_name.
list_decisions_for_reviewlimitinteger201 to 100. The agent allows 1 to 50.

Write tools​

ToolParameterTypeDefaultRange and notes
create_tasktask_namestringrequired1 to 200 characters.
create_taskgoalstringrequired1 to 4000 characters.
create_taskrequest_idstringrequired1 to 64 characters.
record_eventtask_namestringrequired1 to 200 characters.
record_eventkindstringrequiredmessage, tool_call, tool_result, or note.
record_eventpayloadstringrequiredUp to 1,000,000 characters as input. Stored text is cut to 32000 characters, and the event records the hash of the full text.
record_eventrolestringNone100 characters at most.
record_eventnamestringNone200 characters at most.
record_eventrequest_idstringrequired1 to 64 characters.
set_steptask_namestringrequired1 to 200 characters. The agent takes no task_name.
set_stepnamestringrequired1 to 200 characters.
set_stepstatestringrequiredThe step states listed for list_steps.
set_stepkindstringotherread, analysis, or other.
set_stepresult_event_seqintegerNoneMCP only. 1 or more. The sequence number of the event that holds the result.
set_stepresult_basisstringunknownindependent, supported, or unknown.
set_stepsupportslistNone20 items at most.
set_steprequest_idstringrequiredMCP only. 1 to 64 characters.
set_stepresultstringNoneAgent only. Required when state is completed. It is recorded as a note event, and a result over 32000 characters leaves the step unresolved.
record_decisiontask_namestringrequired1 to 200 characters. The agent takes no task_name.
record_decisionchoice_keystringrequired1 to 200 characters.
record_decisionconclusionstringrequired1 to 4000 characters.
record_decisionrationalestringrequired1 to 8000 characters.
record_decisionsupportslistrequired1 to 20 typed supports.
record_decisionassumptionslist of stringsrequired on MCP, None on the agent20 items at most. Send an empty list for none on MCP.
record_decisionopen_questionslist of stringsrequired on MCP, None on the agent20 items at most. Send an empty list for none on MCP.
record_decisionrequest_idstringrequiredMCP only. 1 to 64 characters.
supersede_decisiondecision_idUUIDrequired
supersede_decisionconclusionstringrequired1 to 4000 characters.
supersede_decisionrationalestringrequired1 to 8000 characters.
supersede_decisionexplanationstringrequired1 to 4000 characters.
supersede_decisionsupportslistrequired1 to 20 typed supports.
supersede_decisionassumptionslist of stringsrequired on MCP, None on the agent20 items at most. Send an empty list for none on MCP.
supersede_decisionopen_questionslist of stringsrequired on MCP, None on the agent20 items at most. Send an empty list for none on MCP.
supersede_decisionrequest_idstringrequiredMCP only. 1 to 64 characters.
reaffirm_decisiondecision_idUUIDrequired
reaffirm_decisionevidence_idslist of stringsrequired1 to 20 ids, fetched in this session.
reaffirm_decisionexplanationstringrequired on MCP, default text on the agent1 to 4000 characters on MCP. The agent default is Reaffirmed after current evidence review.
reaffirm_decisionrequest_idstringrequiredMCP only. 1 to 64 characters.
continue_decision_reviewlimitinteger201 to 100. The agent allows 0 to 50.
reject_decisiondecision_idUUIDrequiredMCP only, and only when MCP_ALLOW_REJECT is true.
reject_decisionreasonstringrequired1 to 4000 characters.
reject_decisionrequest_idstringrequired1 to 64 characters.

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
Stored text of one event32000 characters. A completed step result must fit.32000 characters. The event records the hash of the full text and a truncated flag.
Request IDNot used.1 to 64 characters.
Tool calls in one runmax_tool_calls, default 20none
Steps in one runrecursion_limit, default 50none

Search, fetch, and check-citations results count their JSON twice, once for each copy the SDK sends, and set truncated when they drop trailing items to fit MCP_MAX_RESPONSE_CHARS. The other MCP tools count their JSON once, plus the 35-character text block the server sends beside it, and count UTF-8 bytes. Their results are not cut, so a result over the limit returns an error. Agent loop describes the agent settings, and the configuration reference lists the MCP variables.