r1.* MCP Tool Catalog

r1.* MCP Tool Catalog

Generated by r1 mcp serve --print-tools --markdown. Total tools: 38.

session (6)

r1.session.start

Start a new r1 session bound to a workdir. Returns session_id used by every other r1.* tool.

Input schema:

{
  "type": "object",
  "properties": {
    "workdir": {
      "type": "string",
      "description": "Absolute path. Becomes SessionRoot per D-D2."
    },
    "model": {
      "type": "string",
      "description": "Model alias (e.g. 'claude-sonnet-4-6'). Defaults to config.",
      "default": ""
    },
    "resume_session_id": {
      "type": "string",
      "description": "If set, resume the prior session instead of creating a new one."
    }
  },
  "required": [
    "workdir"
  ]
}

r1.session.send

Send a user message to a session. Returns messageid. Idempotent on (sessionid, clientmessageid).

Input schema:

{
  "type": "object",
  "properties": {
    "session_id": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "client_message_id": {
      "type": "string",
      "description": "Caller-chosen idempotency key."
    }
  },
  "required": [
    "session_id",
    "message"
  ]
}

r1.session.cancel

Cancel the in-flight turn for a session. Per D-C4, drops partial assistant message; drains SSE; never persists partial state.

Input schema:

{
  "type": "object",
  "properties": {
    "session_id": {
      "type": "string"
    }
  },
  "required": [
    "session_id"
  ]
}

r1.session.list

List sessions on this daemon. Read-only.

Input schema:

{
  "type": "object",
  "properties": {
    "include_finished": {
      "type": "boolean",
      "default": false
    }
  }
}

r1.session.get

Get full session state: workdir, model, status, last seq, lane summary.

Input schema:

{
  "type": "object",
  "properties": {
    "session_id": {
      "type": "string"
    }
  },
  "required": [
    "session_id"
  ]
}

r1.session.resume

Resume a paused or disconnected session. Replays bus events since last_seq.

Input schema:

{
  "type": "object",
  "properties": {
    "session_id": {
      "type": "string"
    },
    "since_seq": {
      "type": "integer",
      "default": 0
    }
  },
  "required": [
    "session_id"
  ]
}

lanes (5)

r1.lanes.list

List lanes for a session with status (pending|running|blocked|done|errored|cancelled — D-S1).

Input schema:

{
  "type": "object",
  "properties": {
    "session_id": {
      "type": "string"
    }
  },
  "required": [
    "session_id"
  ]
}

r1.lanes.subscribe

Stream lane events (SSE/WS). Server emits LaneEvent at 5–10 Hz coalesced (D-S2). Client must consume or back-pressure.

Input schema:

{
  "type": "object",
  "properties": {
    "session_id": {
      "type": "string"
    },
    "since_seq": {
      "type": "integer",
      "default": 0
    }
  },
  "required": [
    "session_id"
  ]
}

r1.lanes.get

Fetch one lane: status, model, started_at, message tail, latest Note refs.

Input schema:

{
  "type": "object",
  "properties": {
    "session_id": {
      "type": "string"
    },
    "lane_id": {
      "type": "string"
    }
  },
  "required": [
    "session_id",
    "lane_id"
  ]
}

r1.lanes.kill

Terminate a lane (SIGTERM → SIGKILL via procutil). Idempotent: no-op if lane already finished.

Input schema:

{
  "type": "object",
  "properties": {
    "session_id": {
      "type": "string"
    },
    "lane_id": {
      "type": "string"
    }
  },
  "required": [
    "session_id",
    "lane_id"
  ]
}

r1.lanes.pin

Pin a lane to the spotlight (TUI focus + web sidebar). Per D-C1 GWT spotlight semantics.

Input schema:

{
  "type": "object",
  "properties": {
    "session_id": {
      "type": "string"
    },
    "lane_id": {
      "type": "string"
    },
    "pinned": {
      "type": "boolean",
      "default": true
    }
  },
  "required": [
    "session_id",
    "lane_id"
  ]
}

cortex (5)

r1.cortex.notes

Read the Workspace: list of Notes published by Lobes this turn (and prior turns within the cache window).

Input schema:

{
  "type": "object",
  "properties": {
    "session_id": {
      "type": "string"
    },
    "since_seq": {
      "type": "integer",
      "default": 0
    }
  },
  "required": [
    "session_id"
  ]
}

r1.cortex.publish

Publish a Note to the Workspace from an external agent. Useful for tests and human-in-the-loop hints.

Input schema:

{
  "type": "object",
  "properties": {
    "session_id": {
      "type": "string"
    },
    "note": {
      "type": "object",
      "properties": {
        "text": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "critical": {
          "type": "boolean",
          "default": false
        }
      },
      "required": [
        "text"
      ]
    }
  },
  "required": [
    "session_id",
    "note"
  ]
}

r1.cortex.lobes_list

List Lobes (memory-recall, rule-check, plan-update, clarifying-Q, memory-curator, WAL-keeper). Status + last activity.

Input schema:

{
  "type": "object",
  "properties": {
    "session_id": {
      "type": "string"
    }
  },
  "required": [
    "session_id"
  ]
}

r1.cortex.lobe_pause

Pause a specific Lobe for a session (e.g. silence the rule-check Lobe during a known-good test).

Input schema:

{
  "type": "object",
  "properties": {
    "session_id": {
      "type": "string"
    },
    "lobe": {
      "type": "string"
    }
  },
  "required": [
    "session_id",
    "lobe"
  ]
}

r1.cortex.lobe_resume

Resume a previously-paused Lobe.

Input schema:

{
  "type": "object",
  "properties": {
    "session_id": {
      "type": "string"
    },
    "lobe": {
      "type": "string"
    }
  },
  "required": [
    "session_id",
    "lobe"
  ]
}

mission (4)

r1.mission.create

Create a mission (multi-turn, multi-lane unit of work). Returns mission_id.

Input schema:

{
  "type": "object",
  "properties": {
    "session_id": {
      "type": "string"
    },
    "spec": {
      "type": "object",
      "description": "Mission spec — plan-shaped, see plan/ package."
    }
  },
  "required": [
    "session_id",
    "spec"
  ]
}

r1.mission.list

List missions for a session (or all sessions if session_id omitted).

Input schema:

{
  "type": "object",
  "properties": {
    "session_id": {
      "type": "string"
    }
  }
}

r1.mission.cancel

Cancel a mission. Idempotent.

Input schema:

{
  "type": "object",
  "properties": {
    "mission_id": {
      "type": "string"
    }
  },
  "required": [
    "mission_id"
  ]
}

r1.mission.get

Get mission state: phase, tasks, attempts, lanes, artifacts, cost.

Input schema:

{
  "type": "object",
  "properties": {
    "mission_id": {
      "type": "string"
    }
  },
  "required": [
    "mission_id"
  ]
}

worktree (4)

r1.worktree.list

List worktrees for a session: path, basecommit, status, laneid owner.

Input schema:

{
  "type": "object",
  "properties": {
    "session_id": {
      "type": "string"
    }
  },
  "required": [
    "session_id"
  ]
}

r1.worktree.diff

Return git diff BaseCommit..HEAD for a worktree. Token-budget caps at 200KiB unless 'full': true.

Input schema:

{
  "type": "object",
  "properties": {
    "worktree_id": {
      "type": "string"
    },
    "full": {
      "type": "boolean",
      "default": false
    }
  },
  "required": [
    "worktree_id"
  ]
}

r1.worktree.merge

Merge a worktree to main via 'git merge-tree --write-tree' (zero-side-effect validation) then 'git merge'. Serialized by mergeMu.

Input schema:

{
  "type": "object",
  "properties": {
    "worktree_id": {
      "type": "string"
    },
    "strategy": {
      "type": "string",
      "enum": [
        "ff-only",
        "squash",
        "ours"
      ],
      "default": "ff-only"
    }
  },
  "required": [
    "worktree_id"
  ]
}

r1.worktree.clean

Destroy a worktree (--force + os.RemoveAll fallback + worktree prune). Idempotent.

Input schema:

{
  "type": "object",
  "properties": {
    "worktree_id": {
      "type": "string"
    }
  },
  "required": [
    "worktree_id"
  ]
}

bus (2)

r1.bus.tail

Stream bus events from since_seq (SSE/WS framing). Causality-ordered per WAL.

Input schema:

{
  "type": "object",
  "properties": {
    "session_id": {
      "type": "string"
    },
    "since_seq": {
      "type": "integer",
      "default": 0
    }
  },
  "required": [
    "session_id"
  ]
}

r1.bus.replay

Replay bus events for [fromseq, toseq] inclusive. Read-only; deterministic.

Input schema:

{
  "type": "object",
  "properties": {
    "session_id": {
      "type": "string"
    },
    "from_seq": {
      "type": "integer"
    },
    "to_seq": {
      "type": "integer"
    }
  },
  "required": [
    "session_id",
    "from_seq",
    "to_seq"
  ]
}

verify (3)

r1.verify.build

Run 'go build ./...' (or detected toolchain) in the worktree. Returns exit_code, log tail.

Input schema:

{
  "type": "object",
  "properties": {
    "worktree_id": {
      "type": "string"
    }
  },
  "required": [
    "worktree_id"
  ]
}

r1.verify.test

Run scoped tests (testselect package decides scope). Returns pass/fail counts + failing test names.

Input schema:

{
  "type": "object",
  "properties": {
    "worktree_id": {
      "type": "string"
    },
    "packages": {
      "type": "array",
      "items": {
        "type": "string"
      }
    }
  },
  "required": [
    "worktree_id"
  ]
}

r1.verify.lint

Run 'go vet' + project linters. Includes the lint-view-without-api scanner.

Input schema:

{
  "type": "object",
  "properties": {
    "worktree_id": {
      "type": "string"
    }
  },
  "required": [
    "worktree_id"
  ]
}

tui (4)

r1.tui.press_key

Inject a tea.Msg into a teatest harness. Keys: 'k', 'j', 'enter', 'esc', 'ctrl+c', 'tab'. Char keys: '<x>'.

Input schema:

{
  "type": "object",
  "properties": {
    "tui_session_id": {
      "type": "string"
    },
    "key": {
      "type": "string"
    }
  },
  "required": [
    "tui_session_id",
    "key"
  ]
}

r1.tui.snapshot

Capture {view: string (deterministic ANSI-stripped), tree: {role,name,state}[], focus: stable_id}. No screenshots, no OCR.

Input schema:

{
  "type": "object",
  "properties": {
    "tui_session_id": {
      "type": "string"
    }
  },
  "required": [
    "tui_session_id"
  ]
}

r1.tui.get_model

Introspect the live tea.Model via reflection (Noteleaf pattern). Returns JSON projection at jsonpath.

Input schema:

{
  "type": "object",
  "properties": {
    "tui_session_id": {
      "type": "string"
    },
    "jsonpath": {
      "type": "string",
      "default": "$"
    }
  },
  "required": [
    "tui_session_id"
  ]
}

r1.tui.focus_lane

Focus a specific lane in the TUI (equivalent to pressing 'j'/'k' until lane_id is the spotlight).

Input schema:

{
  "type": "object",
  "properties": {
    "tui_session_id": {
      "type": "string"
    },
    "lane_id": {
      "type": "string"
    }
  },
  "required": [
    "tui_session_id",
    "lane_id"
  ]
}

web (4)

r1.web.navigate

Navigate the r1d web UI. Thin wrapper over Playwright MCP 'browser_navigate'.

Input schema:

{
  "type": "object",
  "properties": {
    "url": {
      "type": "string"
    }
  },
  "required": [
    "url"
  ]
}

r1.web.click

Click by accessibility selector (role + name preferred; data-testid fallback). Wraps Playwright MCP 'browser_click'.

Input schema:

{
  "type": "object",
  "properties": {
    "selector": {
      "type": "string"
    }
  },
  "required": [
    "selector"
  ]
}

r1.web.fill

Fill a form field by accessibility selector. Wraps Playwright MCP 'browser_fill'.

Input schema:

{
  "type": "object",
  "properties": {
    "selector": {
      "type": "string"
    },
    "value": {
      "type": "string"
    }
  },
  "required": [
    "selector",
    "value"
  ]
}

r1.web.snapshot

Return the structured a11y tree (NOT a screenshot). Wraps Playwright MCP 'browser_snapshot'.

Input schema:

{
  "type": "object",
  "properties": {}
}

cli (1)

r1.cli.invoke

One-shot wrapper around 'r1 <args>' for headless ops. Returns {exitcode, stdout, stderr, durationms}. Process-group isolated.

Input schema:

{
  "type": "object",
  "properties": {
    "args": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "workdir": {
      "type": "string"
    },
    "stdin": {
      "type": "string",
      "default": ""
    },
    "timeout_sec": {
      "type": "integer",
      "default": 120
    }
  },
  "required": [
    "args",
    "workdir"
  ]
}

Pages in this directory