# Operations and failure codes

> The operations the app accepts from the CLI and MCP, and the closed set of failure codes.

Both the CLI and MCP map onto Pixling's closed catalog of typed operations and failure codes.

## Quick index by domain

| Domain | Operations | Reference |
| --- | --- | --- |
| Session & inbox | `resident.ensure`, `resident.requestClose`, `inbox.watch`, `inbox.read` | [Resident binding](/docs/reference/resident-binding/), [Inbox](/docs/reference/inbox/) |
| Speech & questions | `message.send`, `question.ask`, `question.result`, `question.cancel`, `conversation.read` | [Messages and questions](/docs/reference/messages-and-questions/) |
| Residents & placement | `residents.list`, `zukan.list`, `resident.place`, `resident.desktopVisibility`, `resident.summon`, `resident.duplicate`, `resident.stow` | [Residents](/docs/reference/residents/) |
| Settings & inspection | `resident.describe`, `resident.set`, `resident.sketch`, `resident.pixels`, `settings.get`, `settings.set` | [Resident settings](/docs/reference/resident-settings/), [App settings](/docs/reference/settings/) |
| Motion & sequences | `resident.glow`, `resident.emote`, `resident.bounce`, `resident.throw`, `resident.status`, `status.define`, `sequence.*` | [Light (glow)](/docs/reference/light/), [Sequences](/docs/reference/sequences/), [Residents](/docs/reference/residents/) |
| Groups & relations | `group.*`, `relation.*` | [Groups and relations](/docs/reference/groups-and-relations/) |
| Notes, import & app | `note.*`, `import.*`, `capabilities.get`, `app.quit` | [Notes](/docs/reference/notes/), [Import](/docs/reference/import/), [App settings](/docs/reference/settings/) |

## Operations

All public operations in the exact order `capabilities.get` returns them. Most MCP tools and CLI subcommands map 1:1 to an entry below.

- **`read`**: observes state and changes nothing.
- **`write`**: may change the desk or persisted state (such as a message's read status); see [Effects and retries](/docs/connect/effects/).

| operation | access |
| --- | --- |
| `group.list` | read |
| `group.create` | write |
| `group.rename` | write |
| `group.delete` | write |
| `group.members` | read |
| `group.add` | write |
| `group.remove` | write |
| `relation.list` | read |
| `relation.define` | write |
| `relation.update` | write |
| `relation.delete` | write |
| `relation.links` | read |
| `relation.link` | write |
| `relation.unlink` | write |
| `relation.fire` | write |
| `capabilities.get` | read |
| `note.get` | read |
| `note.set` | write |
| `residents.list` | read |
| `inbox.watch` | read |
| `inbox.read` | write |
| `message.send` | write |
| `resident.glow` | write |
| `resident.emote` | write |
| `resident.bounce` | write |
| `resident.throw` | write |
| `resident.status` | write |
| `status.define` | write |
| `sequence.start` | write |
| `sequence.get` | read |
| `sequence.cancel` | write |
| `sequence.save` | write |
| `sequence.list` | read |
| `sequence.delete` | write |
| `question.ask` | write |
| `question.result` | write |
| `question.cancel` | write |
| `resident.requestClose` | write |
| `resident.place` | write |
| `resident.describe` | read |
| `resident.set` | write |
| `resident.desktopVisibility` | write |
| `zukan.list` | read |
| `resident.ensure` | write |
| `resident.summon` | write |
| `resident.duplicate` | write |
| `resident.stow` | write |
| `resident.sketch` | read |
| `resident.pixels` | read |
| `import.prepare` | write |
| `import.adopt` | write |
| `settings.get` | read |
| `settings.set` | write |
| `conversation.read` | read |
| `app.quit` | write |
| `kit.list` | read |
| `kit.describe` | read |
| `kit.set` | write |
| `kit.duplicate` | write |
| `kit.delete` | write |
| `kit.import` | write |
| `kit.export` | write |
| `kit.preview` | read |
| `kit.propList` | read |
| `kit.propImport` | write |

## Failure codes

Failures fall into two layers depending on whether the app could dispatch an operation:

- **Control failure (`pixling.control.failure`)**: returned when a request cannot be turned into an operation (no `invocationID`).
- **Operation failure (`error.code`)**: returned when a dispatched operation fails.

> [!NOTE]
> **Argument refusals happen before the app**
> `invalidArguments` is produced by the CLI or MCP argument validator before the request ever reaches the app, so it does not appear in the generated lists below. See [Read refusals](/docs/connect/errors/) for how to handle both layers.

- `pixling.control.failure` (no invocation): `malformedRequest`, `unknownOperation`, `requestTooLarge`, `unsupportedSchema`, `unauthorized`, `rateLimited`, `busy`, `incompleteRequest`, `internalFailure`.
- Operation failure `error.code`: `unavailable`, `targetNotFound`, `targetAmbiguous`, `targetMustBeSingular`, `rejected`, `rateLimited`, `internalFailure`.
