Skip to content

MCP Tools Reference

Read a value from state at any branch, tag, or commit.

Parameters:

NameTypeRequiredDefaultDescription
refstringno"main"Branch, tag, or commit ID
pathstringyesJSON path (e.g., /nodes/0/status). Use / for entire state.

Example input:

{ "ref": "main", "path": "/cluster/name" }

Example output:

"prod"

Write a value to state, creating a new atomic commit with intent metadata.

Parameters:

NameTypeRequiredDefaultDescription
refstringno"main"Branch to commit to
pathstringyesJSON path to set
valueanyyesJSON value to write
intent_categorystringyesExplore, Refine, Fix, Rollback, Checkpoint, Merge, Migrate
intent_descriptionstringyesWhy this change is being made
reasoningstringnoAgent’s chain-of-thought
confidencenumbernoSelf-assessed confidence (0.0-1.0)
tagsstring[]noQueryable tags

Example input:

{
"path": "/cluster/replicas",
"value": 3,
"intent_category": "Refine",
"intent_description": "Scale to 3 replicas",
"reasoning": "Traffic increased 40% over last hour",
"confidence": 0.85,
"tags": ["scaling", "auto"]
}

Example output:

Committed: a1b2c3d4

Remove a value from state, creating a new commit.

Parameters:

NameTypeRequiredDefaultDescription
refstringno"main"Branch
pathstringyesJSON path to delete
intent_categorystringyesIntent category
intent_descriptionstringyesWhy this deletion

Example input:

{
"path": "/cluster/deprecated_config",
"intent_category": "Fix",
"intent_description": "Remove deprecated config field"
}

Example output:

Deleted and committed: e5f6g7h8

Create a new branch from any ref. Supports namespaced names.

Parameters:

NameTypeRequiredDefaultDescription
namestringyesBranch name (supports / namespacing)
fromstringno"main"Ref to branch from

Example input:

{ "name": "agents/planner/workspace", "from": "main" }

Example output:

Branch 'agents/planner/workspace' created at a1b2c3d4

List all branches, optionally filtered by namespace prefix.

Parameters:

NameTypeRequiredDefaultDescription
prefixstringnoNamespace prefix filter

Example input:

{ "prefix": "agents/" }

Example output:

2 branches:
agents/planner/workspace -> a1b2c3d4
agents/executor/workspace -> e5f6g7h8

Merge source branch into target. Uses schema-aware merge. Returns conflicts if auto-resolution fails.

Parameters:

NameTypeRequiredDefaultDescription
sourcestringyesBranch to merge from
targetstringno"main"Branch to merge into
intent_descriptionstringyesWhy this merge
reasoningstringnoReasoning for merge

Example input:

{
"source": "feature/new-network",
"target": "main",
"intent_description": "Adopt flannel network config",
"reasoning": "Lower overhead than calico in benchmarks"
}

Example output (success):

Merged 'feature/new-network' into 'main': i9j0k1l2

Example output (conflict):

CONFLICTS (1):
[
{
"path": "/cluster/network/dns",
"base": "8.8.8.8",
"ours": "1.1.1.1",
"theirs": "9.9.9.9"
}
]

Structured diff between two refs. Returns typed DiffOps, not text diffs.

Parameters:

NameTypeRequiredDefaultDescription
ref_astringyesFirst ref
ref_bstringyesSecond ref

Example input:

{ "ref_a": "main", "ref_b": "feature/v2" }

Example output:

2 changes:
[
{ "op": "SetValue", "path": "/app/version", "value": "2.0" },
{ "op": "AddKey", "path": "/app/features/dark-mode", "value": true }
]

Create a lightweight speculation from a ref. O(1) creation.

Parameters:

NameTypeRequiredDefaultDescription
fromstringno"main"Ref to speculate from
labelstringnoHuman-readable label

Example input:

{ "from": "main", "label": "try-ceph-storage" }

Example output:

Speculation created: handle_id=1 (from 'main', label: "try-ceph-storage")

Modify state within a speculation. Changes are isolated until committed.

Parameters:

NameTypeRequiredDefaultDescription
handle_idnumberyesSpeculation handle ID
operationsarrayyesArray of {op, path, value?}

Each operation has:

  • op: "set" or "delete"
  • path: JSON path
  • value: required for "set"

Example input:

{
"handle_id": 1,
"operations": [
{ "op": "set", "path": "/storage/type", "value": "ceph" },
{ "op": "set", "path": "/storage/replicas", "value": 3 },
{ "op": "delete", "path": "/storage/legacy" }
]
}

Example output:

Applied 3 operations to speculation 1

Compare multiple speculations. Returns diffs showing how each diverges from base.

Parameters:

NameTypeRequiredDefaultDescription
handle_idsnumber[]yesSpeculation handle IDs to compare

Example input:

{ "handle_ids": [1, 2] }

Example output:

[
{
"handle": 1,
"label": "try-ceph",
"changes": 2,
"diff": [
{ "op": "SetValue", "path": "/storage/type", "value": "ceph" },
{ "op": "SetValue", "path": "/storage/replicas", "value": 3 }
]
},
{
"handle": 2,
"label": "try-nfs",
"changes": 1,
"diff": [
{ "op": "SetValue", "path": "/storage/type", "value": "nfs" }
]
}
]

Promote a speculation to a real commit on its base branch. The speculation is consumed.

Parameters:

NameTypeRequiredDefaultDescription
handle_idnumberyesSpeculation handle ID
intent_categorystringyesIntent category
intent_descriptionstringyesWhy this approach was chosen
reasoningstringnoReasoning
confidencenumbernoConfidence (0.0-1.0)

Example input:

{
"handle_id": 2,
"intent_category": "Checkpoint",
"intent_description": "Use NFS storage",
"reasoning": "Only 2 nodes available, Ceph needs 3+",
"confidence": 0.9
}

Example output:

Speculation committed: m3n4o5p6

Discard a speculation. All changes freed immediately.

Parameters:

NameTypeRequiredDefaultDescription
handle_idnumberyesSpeculation handle ID

Example input:

{ "handle_id": 1 }

Example output:

Speculation 1 discarded

List commits with full intent, reasoning, and metadata.

Parameters:

NameTypeRequiredDefaultDescription
refstringno"main"Branch or ref
limitnumberno10Max commits to return

Example input:

{ "ref": "main", "limit": 3 }

Example output:

[
{
"id": "a1b2c3d4",
"agent": "mcp-agent",
"intent": {
"category": "Refine",
"description": "Scale to 3 replicas",
"tags": ["scaling"]
},
"reasoning": "Traffic increased 40%",
"confidence": 0.85,
"parents": 1,
"timestamp": "2026-04-06T12:00:00Z"
}
]

Query commits with composable filters. All filters are AND-combined.

Parameters:

NameTypeRequiredDefaultDescription
refstringno"main"Branch to query
agent_idstringnoFilter by agent
intent_categorystringnoFilter by category
tagsstring[]noFilter by tags (all must match)
authority_principalstringnoFilter by authority
reasoning_containsstringnoFull-text search in reasoning
confidence_minnumbernoMinimum confidence
confidence_maxnumbernoMaximum confidence
has_deviationsbooleannoOnly results with deviations
limitnumberno20Max results

Example input:

{
"agent_id": "agent/scaler",
"intent_category": "Refine",
"confidence_min": 0.8,
"limit": 5
}

Example output:

[
{
"id": "a1b2c3d4",
"agent": "agent/scaler",
"intent": {
"category": "Refine",
"description": "Scale to 3 replicas",
"tags": ["scaling"]
},
"reasoning": "Traffic increased 40%",
"confidence": 0.85,
"timestamp": "2026-04-06T12:00:00Z"
}
]

Find which commit last modified a value at a path and why.

Parameters:

NameTypeRequiredDefaultDescription
refstringno"main"Branch
pathstringyesPath to blame

Example input:

{ "path": "/cluster/replicas" }

Example output:

{
"commit_id": "a1b2c3d4",
"agent": "agent/scaler",
"intent": {
"category": "Refine",
"description": "Scale to 3 replicas"
},
"reasoning": "Traffic increased 40%",
"confidence": 0.85,
"timestamp": "2026-04-06T12:00:00Z"
}

Create a new epoch to group related work.

Parameters:

NameTypeRequiredDefaultDescription
idstringyesEpoch ID (e.g., "2026-04-incident-node3")
descriptionstringyesDescription
root_intentsstring[]yesRoot intent IDs that define this epoch

Example input:

{
"id": "2026-04-incident-node3",
"description": "Node3 failure recovery",
"root_intents": ["intent-001", "intent-002"]
}

Example output:

Epoch '2026-04-incident-node3' created (status: Open)

Seal an epoch, making it read-only and tamper-evident. Cannot be undone.

Parameters:

NameTypeRequiredDefaultDescription
idstringyesEpoch ID
summarystringyesFinal summary

Example input:

{
"id": "2026-04-incident-node3",
"summary": "Node3 recovered. Replicas restored to 3. No data loss."
}

Example output:

Epoch '2026-04-incident-node3' sealed

List all epochs with their status, dates, and commit counts.

Parameters: None.

Example output:

[
{
"id": "2026-04-incident-node3",
"description": "Node3 failure recovery",
"status": "Sealed",
"commits": 12,
"agents": ["agent/monitor", "agent/recovery"],
"tags": ["incident", "node3"],
"created": "2026-04-06T10:00:00Z",
"sealed": "2026-04-06T11:30:00Z"
}
]

List active agent sessions with parent-child relationships and path scoping.

Parameters:

NameTypeRequiredDefaultDescription
agent_idstringnoFilter by agent

Example input:

{ "agent_id": "agent/planner" }

Example output:

[
{
"id": "session-001",
"agent": "agent/planner",
"branch": "agents/planner/workspace",
"parent_session": null,
"delegated_intent": "intent-001",
"report_to": "cbrown",
"path_scope": "/cluster",
"created": "2026-04-06T12:00:00Z"
}
]