# MCP tool reference

> Complete catalog of pitafix mcp tools across 7 domains, input/output conventions, flags, timeouts, and reply limits.

Command:

```sh
pitafix mcp --project <repo> [--agent <name>] [--run <id>] [--record] [--browser <path>] [--cef-host <path>] [--allow-host <host>]
```

## Protocol conventions & limits

- **Transport:** stdio MCP (stdout carries MCP frames; diagnostics go to stderr). Exits `0` on EOF/SIGTERM, `1` on missing root commit or store error, `2` on usage error.
- **Naming:** tool inputs use `snake_case`; JSON replies use `camelCase`.
- **Actor identity:** writes record `store.Agent(name)` from `--agent`, then `$PITAFIX_AGENT`, then `"agent"` (never `store.Person`).
- **Timeouts & size caps:** standard tools `20s`, store open `10s`, max serialized reply `2 MiB` (narrow with `limit`, filters, or `compact: true`). Recording tools (`--record`): `60s` for `record_start`/`record_step`/`record_inspect`/`record_finish`, `2m` for iOS `reload`, `10m` for iOS `record_start` with build. All tools set `OpenWorldHint: false`.
- **Security & modes:** see [Trust & boundaries](https://pitafix.app/wiki/agents/trust-and-boundaries.md) for `"untrusted": true` envelopes and [Work tasks & epics](https://pitafix.app/wiki/agents/work-tasks.md) for standalone vs `--run` lifecycle rules.

## 1. Comments & review lifecycle

| Tool | Mode | Key parameters & behavior |
| --- | --- | --- |
| `list_open_comments` | Read | `status?[]`, `journey_id?`, `screen_id?`, `frame_id?`, `limit?` (1–200, default 50). Excludes `resolved`/`dismissed` by default. Includes `areas`, `scrolled`, `type`. |
| `get_comment` | Read | `id`. Full text, `photos[]`, `pin` + `areas` (fractions & px), `areaLinks`, composed scrolled screenshot & tree if `scrolled`, anchors, `thread[]`, status history. |
| `claim_comment` | Write | `id`. Moves to `working`. Refuses another agent's claim, `needs_review`, `resolved`, `dismissed`. Idempotent no-op for the same agent under `--run`. |
| `reply_to_comment` | Write | `id`, `text` (Markdown, ≤8,000 chars). Adds a thread reply. |
| `ask_person` | Write | `id`, `question` (≤4,000 chars). Prefixes `"**Question**"` and moves status to `blocked`. Under `--run`, end your turn immediately; standalone agents call `claim_comment` to resume after reply. |
| `submit_for_review` | Write | `id`, `summary` (≤6,000 chars), `files?[]` (≤200 repo-relative paths), `evidence?[]` (≤50 strings). Moves to `needs_review` (`**Submitted for review**`). |
| `resolve_comment` | Read | `id?`, `reason?`. **Always refuses** — only a human resolves comments. |

## 2. Map, screens, journeys & behavioral understanding

| Tool | Mode | Key parameters & behavior |
| --- | --- | --- |
| `get_app_map` | Read | `section?`. Domain `areas[]`, cross-area `links`, totals, platforms, proof levels, data sources, freshness, and `unreachedRoutes`. |
| `list_screens` | Read | `query?`, `section?`, `surface?`, `platform?`, `compact?`, `limit?` (1–200, default 50). |
| `list_journeys` | Read | `section?`, `screen_id?`, `query?`, `limit?` (1–200, default 50). |
| `get_screen` | Read | `frame_id` or `screen_id`, `code_tier?`, `code_limit?`, `code_offset?`. Screenshot/tree paths, `behavior{journeys, reachedBy, leadsTo}`, paginated executed code. |
| `get_journey` | Read | `id`, `run_id?`. Ordered steps of the best walk or a specific run. |
| `find_screens` | Read | `file?`, `symbol?`, `lines?` (`"12"` or `"10-20"`), `repo?`, `limit?` (1–200, default 50). Screens that ran that code (fully-run first) + `unreachedRoutes` count. |
| `list_operations` | Read | `category?`, `screen_id?`, `section?`, `query?`, `compact?`, `limit?` (1–200, default 50). Canonical operations (`op_<hex>`). |
| `get_operation` | Read | `operation` (`op_...` or key), `tier?`, `include_ui_code?`, `limit?` (1–100, default 25). Outcomes, UI triggers, tiered code with `partialLines[]`, and recorded `serverEffects`. |
| `list_hot_code` | Read | `tier?`, `repo?`, `sample_steps?` (1–500, default 200), `limit?` (1–200, default 40). Non-accessor symbols ranked by share of sampled steps. |
| `list_dark_files` | Read | `prefix?`, `repo?`, `include_tests?`, `exact?`, `limit?` (1–400, default 100). Tracked source files with zero captured execution + `unreachedRoutes`. |

## 3. UI components & visual scale

| Tool | Mode | Key parameters & behavior |
| --- | --- | --- |
| `list_components` | Read | `kind?` (`button\|row\|field\|checkbox\|tab\|chip\|text\|picture\|card\|bar\|sheet`), `platform?`, `device?`, `limit?` (1–400, default 100). Components, finds (`alike`, `wrapper`, `no component`, `one place`), and `picturesRead`/`unread`. |
| `get_component` | Read | `kind`, `name`, `platform?`, `device?`. Places, `declared` vs `undrawn` calls, `wrappedBy[]`, visual `stateList[]` (pt & `#rrggbb`) + state-specific `code[]`, and `operations[]`. |
| `get_scale` | Read | `measure?` (`gap\|corner\|text\|fill\|ink`), `platform?`, `device?`, `limit?` (1–200, default 10). Kept scale values (≥2%) vs `odd` departures. |
| `get_screen_components` | Read | `frame_id` or `screen_id`, `tree_only?`, `limit?` (1–400, default 150). Element hierarchy (`in`, `level`), scale `departs[]`, `triggers[]`. Pass `tree_only: true` when pictures are unread. |

## 4. Boards

| Tool | Mode | Key parameters & behavior |
| --- | --- | --- |
| `list_boards` | Read | `limit?` (1–200, default 50). |
| `get_board` | Read | `id`, `limit?` (1–400, default 200). |
| `create_board` | Write | `name` (1 line, ≤120 chars). |
| `add_board_items` | Write | `board_id`, `items[]` (≤50; `screen` via `frame_id` or `screen_id`, `note`, `arrow` with `ref` links, `section`). Atomic; omit `x,y` (overlaps are refused). |
| `arrange_board` | Write | `board_id`, `layout` (`row\|grid\|flow`), `item_ids?`. Own items only. |
| `remove_board_items` | Write | `board_id`, `item_ids[]` (≤50). Own items only; refuses if another author's arrow attaches. |

## 5. Plan, epics & Inbox signals

| Tool | Mode | Key parameters & behavior |
| --- | --- | --- |
| `get_plan` | Read | Aspiration, areas/objectives, epics by `column` & `stage`, Inbox waiting count. |
| `get_epic` | Read | `id`. `fromPlan` (`why`, `appetite`, `notDoing[]`), planned `screens[]`, brief `evidence[]`, `commentIds[]`, `journey`, and past `decisions[]`. |
| `create_epic` | Write | `name`, `area?`, `horizon?` (`now\|next\|later`), `why?`, `appetite?`, `not_doing?`, `journey?`. |
| `update_epic` | Write | `id` + fields. Own epics only. |
| `add_epic_screen` | Write | `epic_id`, `kind` (`new\|changed\|kept`), `screen_id?`, `name?`, `change?`, `on?`, `from?`, `states?`. Own epics only. |
| `update_epic_screen` | Write | `id` (planned screen entry ID), `name?`, `change?`, `on?`, `from?`, `states?`. Own epics only. |
| `remove_epic_screen` | Write | `id` (planned screen entry ID). Own epics only. |
| `add_signal` | Write | `text` (≤4,000 chars), `source?`, `ref?`, `screen_id?`. Appends verbatim to Inbox (cap 500 waiting). |

## 6. Blueprints

| Tool | Mode | Key parameters & behavior |
| --- | --- | --- |
| `get_blueprint` | Read | Returns `{ "attached": false }` or attached blueprint metadata, `blueprintDir`, and SHA-256 verified `fromBlueprint`. |

## 7. Live recording — requires `--record`

Registered only when `pitafix mcp` starts with `--record` (also allows creating the project store on first capture).

| Tool | Mode | Key parameters & behavior |
| --- | --- | --- |
| `record_start` | Write | Web (`base_url`, `device`, `data_source`, `seed`, `role`) or native iOS Swapify (`platform: "ios"`, `ios_work_dir`, `ios_device`, `ios_udid`, `ios_device_set`, `ios_no_build`, `ios_attach`, `ios_full_screenshot`). |
| `record_journey` | Write | `session_id`, `id`, `name`, `intent?`, `section?`, `role?`, `seed?`. |
| `record_step` | Write | `session_id`, `kind` (`open\|tap\|hover\|type\|select\|key\|scroll\|back\|upload\|reload\|wait\|snapshot\|set_cookie\|clear_cookies`), `url?`, `selector?` (`role\|name\|css\|test_id\|label\|text\|placeholder\|exact\|nth`), `text?`, `key?`, `scroll_dx?`, `scroll_dy?`, `wait_ms?`, `cookie?`, `files?`, `private?`, `screen?`, `route?`, `surface?`, `label?`, `settle_ms?`, `timeout_ms?`, `include_elements?`. |
| `record_inspect` | Read | `session_id`, `screenshot?`. Read-only DOM/elements/errors inspection without recording a step. |
| `record_unreached` | Write | `session_id`, `routes: [{ route, reason }]`. |
| `record_finish` | Write | `session_id`, `status` (`passed\|failed\|cancelled`), `error?`. Finalizes trace into the store. |
