# ATIP 2: Agent Transport-Independent Protocol (`atip/2`) — Core

Status: **2.0.0-draft**, 2026-12-01.

Annexes: `spec/annex-fields.md` (F, field selection), `spec/annex-domains.md` (V, argument domains and numbers),
`spec/annex-design.md` (S, operation design and self-description rules).

Bindings: `spec/binding-cli.md` (CLI), `spec/binding-http.md` (HTTP), `spec/binding-mcp.md` (MCP).

Contents: 1 Introduction · 2 Terms · 3 Conformance · 4 Operations and input · 5 Response envelope · 6 Errors,
conditions and registries · 7 Effects, idempotency, preview and commit · 8 Paging and field selection · 9 Accepted work
and monitors · 10 Streams · 11 Steps and hints · 12 Self-description · 13 Versioning and caller tolerance ·
14 Security · Appendix A Prior art.

---

## 1. Introduction

1.1. **Purpose.** ATIP (`atip/2`) is a transport-independent protocol between a tool and its caller, usually a coding
agent, a generated client or a script, so that a caller that knows the protocol can discover and run any conforming
tool over any supported binding without reading its source.

1.2. **Scope.** This document defines the transport-free core: what an operation is, what goes in (one JSON input
document), what comes out (one response envelope, or a stream of lines ending in one), how failures are classified, and
the exchanges built on them (preview and commit, paging, field selection, accepted work, streams, self-description and
guides). A binding document (`spec/binding-cli.md`, `spec/binding-http.md`, `spec/binding-mcp.md`) defines only
how requests, envelopes and streams travel on that transport and how derived discovery surfaces are built from the
catalog; a binding adds, drops or renames no core member. How a tool is built is out of scope (`approaches/` is not
normative).

1.3. **The exchanges.**

| Exchange | The caller sends | The tool answers | Sections |
|---|---|---|---|
| Run | `{operation, arguments}` on a binding | one envelope `{ok, data\|error, meta}` | 4–6 |
| Discover | `schema` | the operation tree, operation documents, schemas, the registries | 12 |
| Destructive act | the operation without `commit`, then the commit step from `meta.next[0]` | a plan and its `planDigest`; then the effects or `PLAN_STALE` | 7.5 |
| Page and project | `limit`, `cursor`, `all`, `fields`, or the next-page step from `meta.next` | the page and `meta.page`, or projected `data` and `meta.fields` | 8 |
| Accepted work | the start operation, then the monitor step in `meta.next[0]` | `meta.work` with `state: "working"`, then the monitor's report | 9 |
| Stream | a stream operation | `start`, `event` items, `end` carrying the final envelope | 10 |
| Guide | `skills_show` | the guide for agents | 12.8 |

Every answer tells the caller what happened and what to do next: `ok` whether the operation succeeded (5.1); on failure
`error.refused` whether the operation refused before starting (nothing changed) or failed after starting (6.1.2); the
code's condition what went wrong (6.2); `error.retryable` whether repeating the request unchanged can succeed (6.1.1);
and `meta.next` the runnable follow-up steps (11.1).

1.4. **Normative sources.** The JSON Schemas in `schema/` are normative for wire shapes, and this document does not
restate every keyword they contain; the annexes (`spec/annex-fields.md`, `spec/annex-domains.md`,
`spec/annex-design.md`) and the binding documents are normative where this document refers to them. Where prose and a
schema disagree, the schema wins for shape and the prose for behaviour.

## 2. Terms and notation

2.1. MUST, MUST NOT, REQUIRED, SHALL, SHALL NOT, SHOULD, SHOULD NOT, RECOMMENDED, NOT RECOMMENDED, MAY and OPTIONAL
are to be interpreted as described in BCP 14 (RFC 2119, RFC 8174) when, and only when, they appear in all capitals.

2.2. A **tool** claims conformance and serves **operations** through one or more **bindings** (`cli`, `http`, `mcp`); a
**caller** invokes it. An **operation** is a runnable unit named by its **operation id** (`finding_close`); a **group**
is an id prefix that groups operations (`finding`). An **input document** is the one JSON object of named **arguments**
an operation takes (4.2). The **envelope** is the response document `{ok, data|error, meta}` (5); a **report** is its
`data`; a **stream** is a sequence of `start`, `event` and `end` items over time (10). A **step** is a transport-free
invocation `{operation, arguments}` in `meta.next` or `error.hint` (11). An **effect** is a change to state the tool or
its user owns (7.1). A **refusal** is a failure with `error.refused: true`, after which nothing has changed (6.1.2). A
code's **condition** fixes its `refused` value and default `retryable` (6.2); a **core code** is one every tool shares
(6.4). In `spec/binding-mcp.md`, **MCP tool** always means the MCP protocol object, while an ATIP tool is an MCP
server.

2.3. JSON members are written `like.this`, placeholders `<LIKE_THIS>`; JSON Pointers are RFC 6901.

## 3. Conformance

3.1. A tool conforms on a binding when every operation, document, status and stream on that binding follows this
document, that binding's document, and the annexes for the minor it declares (13.5) and the level it claims. A caller
conforms when it reads documents as 13.4 and 13.6 say and acts only on what the protocol defines, never on
`error.message` or human-facing text.

3.2. **Claims and levels.** A conformance claim names the minor, the binding and the level: `"ATIP 2.0 CLI L2"`,
`"ATIP 2.0 HTTP L1"`, `"ATIP 2.0 MCP L1"`. A tool makes one claim per binding it serves, and at L1 or L2 its `schema`
tree declares `binding` and `level` (12.3). A tool MUST NOT claim a level whose rules it does not follow. Levels are
cumulative and mean the same capability set on every binding:

| Level | Core rules | Sections |CLI binding adds | HTTP binding adds | MCP binding adds |
|---|---|---|---|---|---|
| **L0** | Envelope, error object, registries, outcome and `refused`, versioning, security | 5, 6, 13, 14 | `--json`, stdout and stderr, exits 0/1/2, no prompt | Status mapping, JSON body, framing failures | Result and `isError` mapping, `structuredContent` + text, framing failures |
| **L1** | Operation ids, input document and stateless checks, `schema`, steps that resolve and run, paging and field selection where offered | 4, 8, 11, 12.1–12.7 | Argv grammar, `--input` on every operation, reserved flags, CLI design rules, root `--help` line | `POST` routes, request framing, derived `openapi.json` | Fixed umbrella `tools/list` (`read`, `write`, `destructive`), annotations, `instructions` line |
| **L2** | Preview and commit, dry run, idempotency keys, accepted work and monitors, streams, `skills_show` | 7, 9, 10, 12.8 | Batches where offered, NDJSON streams, `skills show` | 202 and monitor routes, SSE streams | Progress notifications, `skills_show` through `read` |

3.3. A rule never requires a feature of a higher level; a mention of one applies only to a tool that offers it. A tool
MAY offer higher-level features; what it offers MUST follow this document and its binding.

3.4. **Exceptions** (such as a CLI passthrough command or a hook whose stdin another program owns) MUST be declared
through the output kind (12.5.4) and `effectNote` (12.5); there is no other exception mechanism.

3.5. **Parity across bindings.** A tool that serves two bindings MUST serve, for every operation reachable on both, the
same operation document on both once the removals of 12.2.2 are made (an argument's `cli` member, `input.batch`,
`input.maxItems`, batch and artifact outputs). The same request (`{operation, arguments}`) in the same state MUST
answer the same envelope on both bindings, apart from the values that differ between two runs of that request on one
binding (an id or a time the tool makes). A binding's own framing of the answer (an exit status, an HTTP status, a
stream frame) is not part of the envelope.

3.6. **Testing** (informative). Conformance is defined by the specification alone. `approaches/checker.md` describes
`atip check`, a conformance checker that drives a built binary or server from outside through a per-binding driver and
reports evidence for or against a claim, including the parity of two bindings of the same tool (3.5).

## 4. Operations and input

### 4.1. Operation identity and naming

4.1.1. An operation is identified by its **operation id**, a sequence of lower-case words joined by `_`:

```abnf
operation = word *( "_" word )          ; at most 64 characters
word      = lower *( lower / DIGIT ) *( "-" 1*( lower / DIGIT ) )
lower     = %x61-7A
DIGIT     = %x30-39
```

The words are group words followed by a verb (`finding_close`, `billing_invoice_send`) or one root word (`schema`).
`_` never occurs inside a word, so an operation id and its word sequence convert both ways without ambiguity. An
operation id MUST be at most 64 characters and SHOULD be at most 48 characters, so that a host prefix added by a
tool-calling client still fits within 64 characters. A tree MAY declare `pathShape` (12.3): labels chosen by the tool,
one per word of an id of full length (`["product", "noun", "verb"]`); no operation id in the tree has more words
(`spec/annex-design.md` S2 rule 16). The labels tell a caller what each word position of a full-length id names and
carry no other rule; in a shorter id only the last word has a fixed role, the verb (or the root word). A tree without
`pathShape` SHOULD keep its operation ids to at most three words.

4.1.2. A node in the catalog is either a group (an id prefix, such as `finding`) or an operation (`finding_close`),
never both. A request that names a group or names no operation is refused with `OPERATION_REQUIRED`, with `expected`
listing the operation ids under that group (or the top-level operation and group ids of that binding's catalog). A
request that names an id outside the catalog is refused with `OPERATION_NOT_FOUND`, with `expected` listing the valid
operation or group ids at that position: the direct children (operations and groups) of the deepest group that is a
proper prefix of the id named, or, when no prefix is a group, the root entries of that binding's catalog (the operations
and groups of one word). `member_lst` in a catalog with the group `member` lists the `member_*` ids; `nope` lists the
root entries.

4.1.3. The first words `schema` and `skills` are reserved: `schema` is the self-description operation (12.1) and
`skills` is the group of the guide operation `skills_show` (12.8). A tool MUST NOT define any other operation or group
under `schema` or `skills`.

4.1.4. An argument name is its JSON key in the input document, written in lower camelCase matching
`^[a-z][a-z0-9]*([A-Z][a-z0-9]*)*$`. No argument name ends in `Id` (`spec/annex-design.md` S1 item 2). On the CLI,
the long option name is derived from the argument name by converting each capital letter to `-` and lower case
(`forAgent` becomes `--for-agent`), and the pattern makes this derivation reversible (`spec/binding-cli.md` 2.1).

### 4.2. Input document

4.2.1. An operation takes one JSON object, the **input document** (its **arguments**). It has no positional array and
no `null` value except inside a `json` argument's value. Every argument has a core `valueType`:

| Core `valueType` | JSON value in the input document | Default and constraints |
|---|---|---|
| `boolean` | `true` or `false` | Default is `false` (omitted in `schema`); never `required` or `repeatable` |
| `integer` | A JSON integer within ±(2^53−1) | `spec/annex-domains.md` V3; numeric strings are not accepted |
| `number` | A finite binary64 JSON number | `spec/annex-domains.md` V3; numeric strings are not accepted |
| `string` | A JSON string | Domain keywords in `spec/annex-domains.md` V1–V2 |
| `enum` | A JSON string in `possibleValues` | `possibleValues` is required; no `domain` |
| `path` | A JSON string naming a file-system path | Only where tool and caller share a file system (12.2.2) |
| `json` | Any JSON value except a top-level `null` | Domain keywords in `spec/annex-domains.md` V1 |

A repeatable argument (`repeatable: true`, including a CLI variadic operand, `spec/binding-cli.md` 2.3.1) takes a
JSON array of values of its `valueType`. The array is non-empty when the argument is `required` and may be empty
otherwise; an empty array passes no values, as omitting the key does. An argument with
`cli.count: true` (`spec/binding-cli.md` 2.3) has `valueType: "integer"`, a non-negative integer domain
(`minimum: 0`), and default `0`.

4.2.2. **Derived `Input` schema.** Each operation has one derived JSON Schema (draft 2020-12), **`Input`**: an object
schema `{type: "object", additionalProperties: false, properties, required?}` derived solely from the operation's full
argument set (`spec/annex-design.md` S2):

- For each argument, its value schema is built from its `valueType` (`"boolean"` → `{type: "boolean"}`; `"integer"` →
  `{type: "integer", minimum: -9007199254740991, maximum: 9007199254740991}` unless `domain` supplies its own lower or
  upper bound; `"number"` → `{type: "number"}`; `"string"` and `"path"` → `{type: "string"}`; `"enum"` →
  `{type: "string", enum: possibleValues}`; `"json"` →
  `{type: ["string", "number", "boolean", "object", "array"]}` unless `domain` supplies `type`) merged with the
  keywords of `domain` when present.
- When `repeatable` is `true`, the property schema wraps that value schema in
  `{type: "array", items: <value schema>}`, adding `minItems: 1` when `required` is `true`; otherwise the property
  schema is the value schema itself.
- If `help` is present on the argument object (absent on reserved arguments referenced by name), `description` is set to
  `help`; if `default` is present, `default` is copied to the property schema.
- `required` lists the arguments with `required: true` in argument order, and is omitted when none are required.

Multi-argument `constraints` and `validators` (12.5.3) are not encoded in `Input`; the tool enforces them and the
operation document states them.

### 4.3. Reserved and control arguments

4.3.1. **Reserved arguments** have one fixed meaning and shape in every tool. An operation that offers the behaviour
declares them by name in `arguments` (or implies `fields` when an output declares `fields`, 12.5.1):

| Name | `valueType` and domain | Meaning | Control |
|---|---|---|---|
| `commit` | `boolean` | Carry out the previewed destructive plan (7.5) | Yes |
| `planDigest` | `string` | Digest of the previewed plan to commit (7.5) | Yes |
| `limit` | `integer` (`minimum: 1`) | Maximum number of items to return in one page (8.1) | Yes |
| `cursor` | `string` | Opaque continuation token from `meta.page.nextCursor` (8.1) | Yes |
| `all` | `boolean` | Return all items without a page bound (8.1) | Yes |
| `fields` | repeatable `string` (`fieldPath`, `spec/annex-fields.md` F1) | Project `data` to the listed field paths (8.2) | Yes |
| `dryRun` | `boolean` | Run every check and precondition and change nothing (7.6) | No |
| `idempotencyKey` | `string`, `domain.pattern` `^[!-~]{1,255}$` | Caller-chosen retry identity (7.4): 1 to 255 printable ASCII characters, no space and no control character | No |
| `wait` | `boolean` | Wait for accepted work on a monitor operation (9.2) | No |
| `timeout` | `string` (duration, `spec/annex-design.md` S1 item 6) | Maximum time a monitor with `wait: true` waits (9.2) | No |

An empty `planDigest` or `cursor` is refused by the codes that already govern them (`PLAN_STALE`, `CURSOR_INVALID`). The
`idempotencyKey` is bounded by its domain, which the derived `Input` (4.2.2) carries like `limit`'s `minimum`: a key that is
empty, longer than 255 characters, or holds a space, a control character or a non-ASCII character is refused with
`INPUT_INVALID`, reason `INVALID_VALUE`, `field` `"/idempotencyKey"`.

4.3.2. The six **control arguments** (`commit`, `planDigest`, `limit`, `cursor`, `all`, `fields`) select a view of the
output or authorise a destructive commit. Control arguments are never bound by a paging cursor (8.1.2), never appear in
a CLI batch item, and on the CLI are given only as command-line flags, never inside `--input`
(`spec/binding-cli.md` 7.3; a control argument inside `--input` is refused with `INPUT_INVALID`, reason
`CONTROL_IN_DOCUMENT`). On HTTP and MCP, control arguments are ordinary members of the request's JSON input document.

4.3.3. No operation defines an argument named `json`, `input`, `help` or `version`. Those four names are reserved for
CLI transport flags (`spec/binding-cli.md` 3, 5, 7).

### 4.4. Processing order

On every binding, a request is processed in this order, and steps 1–3 read no state:

1. **Decode and frame** the transport request into `{operation, arguments}`, in this order:
   1. the binding's own framing checks (`INPUT_INVALID` with a framing reason);
   2. on a binding that carries a credential with the request, the credential: one presented and invalid or expired is
      refused with `AUTHENTICATION_REQUIRED` (reason `INVALID` or `EXPIRED`), and a request that presents none goes on
      with no caller;
   3. the operation: a group or no operation is `OPERATION_REQUIRED`, an id outside the catalog `OPERATION_NOT_FOUND`;
      a binding MAY answer both with `AUTHENTICATION_REQUIRED` (reason `MISSING`) when the request has no caller and the
      deployment requires one for any operation, so that a caller without a credential cannot enumerate the catalog;
   4. a caller, when the resolved operation requires one and the request has none (`AUTHENTICATION_REQUIRED`, reason
      `MISSING`);
   5. `input.maxBytes` before parsing where declared (`INPUT_TOO_LARGE`), then the input document itself
      (`INPUT_INVALID` with a framing reason).
2. **Validate against `Input`**: check unknown argument keys (`INPUT_INVALID`, reason `UNKNOWN_ARGUMENT`), argument
   types and `possibleValues` (`INVALID_VALUE`), `required` arguments (`MISSING_ARGUMENT`), and each argument's
   `domain` (`INVALID_VALUE`), after filling any absent arguments from declared CLI `env` variables or defaults where
   applicable. When one input document has several validation errors, the tool MAY list all of them in `error.details`
   (6.1.1).
3. **Check `constraints` and `validators`** (12.5.3) on the complete argument set, refusing violations with the
   declared error code (or `INPUT_INVALID`, reason `CONSTRAINT` when a constraint declares no code).
4. **Resolve context and objects, check preconditions** (6.3), reserve `idempotencyKey` when given (7.4), and execute
   the operation. A tool that reads its credential from its own state (a CLI login) authenticates here.

The first failure stops processing and returns a failure envelope. Because steps 1–3 precede any state read or mutation,
every failure in steps 1–3 is a refusal (`error.refused: true`) and leaves state unchanged. Which operations require a
caller is a deployment's choice and not part of the catalog.

### 4.5. Operation and argument design

Operations and arguments follow the design rules of `spec/annex-design.md` S1 (normative at L1): actions are verbs
under noun groups, identifier arguments are bare nouns not ending in `Id`, an argument name has one type and meaning
within its scope, unknown operations or arguments are refused without auto-correction, removed names are not kept as
aliases, and timestamps and durations use standard formats.

## 5. Response envelope

Shape: `schema/envelope.schema.json`. Every JSON document emitted by a tool MUST be compact (no space, tab, CR or LF
outside JSON strings) and encoded in UTF-8.

5.1. A successful response is `{ok: true, data, meta}`. A failed response is `{ok: false, error, meta}`.

5.2. `ok` is `true` on success and `false` on failure. Each binding maps `ok`, `error.refused` and the error code's
condition to its transport outcome signal (`spec/binding-cli.md` 6, `spec/binding-http.md` 4,
`spec/binding-mcp.md` 4).

5.3. Object keys in protocol documents are camelCase, except inside a stored user record embedded verbatim in `data`,
as its output schema declares.

5.4. A failure of an operation that ran (`error.refused: false`) MAY carry its partial report in `data`; a refusal
(`error.refused: true`) MUST NOT carry `data`.

5.5. Absent optional members of the envelope, `meta`, `error`, steps and catalog documents are omitted, never `null`.

5.6. **`meta`** carries only these members and tool extension members matching `^x-[a-z][a-z0-9-]*$` (12.7.2):

| Member | Present | Meaning |
|---|---|---|
| `contract`, `contractVersion` | Always | `"atip/2"` and the declared minor (`"2.0"`, 13.5) |
| `schemaVersion` | Always | Version `<major>.<minor>` of the output schema `data` follows (5.8); on a `schema` answer, the declared minor |
| `tool`, `toolVersion` | Always | The tool name (`^[a-z][a-z0-9]*(-[a-z0-9]+)*$`) and its release string |
| `operation` | On every answer, success or failure, once the operation resolved: on a failure after the route is known (`INPUT_TOO_LARGE`, a body that is not JSON or not an object, every input error, `INTERNAL`) as on a success. On `OPERATION_REQUIRED` always the id of the group the request named, because the route resolved to that group; omitted only when it named none (the bare root). Omitted on a failure before the route resolved: a framing failure of the binding, `OPERATION_NOT_FOUND`, and every `AUTHENTICATION_REQUIRED`, which tells a caller without a credential nothing about the route | The operation id (`finding_close`), or the group id of an `OPERATION_REQUIRED`. `OPERATION_NOT_FOUND` carries `schema` only on the `schema` operation's own refusal of an unknown `operation` argument |
| `output` | With `data`, when the operation declares more than one output | Which output schema in `schemas` `data` follows |
| `work` | On an accepted async answer and every non-refusal answer of a monitor operation (`refused: true` never carries `work`) | `{id, state}` of the asynchronous work (9.1) |
| `context` | OPTIONAL | Resolved context arguments the operation used (5.7) |
| `next` | OPTIONAL | Runnable follow-up steps (`schema/step.schema.json`), best first (11.1) |
| `warnings` | OPTIONAL | Non-fatal warning objects `{code, message, field?}` (6.6) |
| `coverage` | OPTIONAL | What a check or listing examined (6.3.3) |
| `page` | On a paged answer | `{returned, nextCursor?, total?}` (8.1) |
| `truncated` | On an answer cut by size | `{path, kept, total?, bytes?, maxBytes?}` (8.1.3) |
| `fields` | On a field-projected answer | The kept field paths, including `keep` paths (8.2) |

5.7. **Context.** `meta.context` holds, under each context argument's camelCase name, the value the operation used
(explicitly given or resolved from the environment or workspace), so a caller can repeat the request in the same
context.

5.8. **Version of `data`.** `meta.schemaVersion` is the version of the output schema `data` follows; on a failure
without `data`, the version of the output the request would have produced (on the CLI, the batch output for a batch,
else the first non-batch output); `"1.0"` before an operation resolves.

## 6. Errors, conditions and registries

Shapes: `schema/error.schema.json`, `schema/registry-entry.schema.json`, `schema/warning-entry.schema.json`.

### 6.1. The error object

6.1.1. When `ok` is `false`, `error` carries:

- `code` (REQUIRED): an `UPPER_SNAKE_CASE` identifier registered in the tool's error registry (6.5). Callers branch on
  `code` (together with `meta.tool`, which scopes non-core codes across tools).
- `refused` (REQUIRED): a boolean stating whether the operation refused before starting (6.1.2).
- `retryable` (REQUIRED): `true` only when repeating the exact same request unchanged can succeed; MUST equal the code's
  registered `retryable` in the error registry.
- `message` (REQUIRED): a non-empty human-readable description. Callers MUST NOT parse `message`.
- `reason` (OPTIONAL): an `UPPER_SNAKE_CASE` refinement registered under `code` (6.7). Callers MAY ignore `reason`.
- `field` (OPTIONAL): an RFC 6901 JSON Pointer into the input document naming the argument or element at fault
  (`"/round"`, `"/tags/0"`, `""` for the input document as a whole, or `"/<index>/…"` in a CLI batch). An error about
  an operation id that did not resolve omits `field`. An `INPUT_INVALID` error about an argument SHOULD carry `field`.
- `hint` (OPTIONAL): an object `{text?, operation?, arguments?, missing?}` telling the caller or user how to recover
  (11.2). When `INPUT_INVALID` has no `field`, `hint` SHOULD point to `schema` for the resolved operation (or root
  `schema` when no operation resolved).
- `expected` (OPTIONAL): non-empty array of valid strings when a closed set applies.
- `received` (OPTIONAL): the rejected value (any JSON type except `null`), redacted to `"<redacted>"` when it may hold
  a secret (14.1).
- `suggestions` (OPTIONAL): non-empty array of close matches from `expected`, best first.
- `details` (OPTIONAL): array of at least two detail objects `{code, message, reason?, field?, hint?, expected?,
  received?, suggestions?}` when one input yields several errors.

6.1.2. **`refused`.** `error.refused` is `true` when the operation did not start its work and nothing changed; it is
`false` when the operation started its work and the outcome is negative, incomplete or timed out. `refused` is fixed by
the code's entry in the error registry (6.5.2) and travels inside the error object on every binding so that callers on
every transport know whether state may have changed.

### 6.2. Code grammar and conditions

6.2.1. **Grammar.** Every error code a tool defines (other than the core codes of 6.4) names a subject and one of
fifteen conditions. The condition fixes `refused` and the default `retryable`, and tells a caller that has never seen
the tool what kind of recovery action applies. Conditions apply only to `error.code`; a warning code (6.6) has no
`refused` or `retryable`.

```abnf
code      = subject "_" condition
subject   = UPPER *( UPPER / DIGIT ) *( "_" 1*( UPPER / DIGIT ) )
condition = "INVALID" / "REQUIRED" / "NOT_FOUND" / "EXISTS" / "CONFLICT" / "STALE" / "EXPIRED" / "DENIED"
          / "UNSUPPORTED" / "TOO_LARGE" / "CORRUPT" / "UNAVAILABLE" / "FAILED" / "INCOMPLETE" / "TIMEOUT"
UPPER     = %x41-5A
```

The subject is a non-empty noun phrase naming the object, argument, resource or unit of work (`PROMOTION`, not
`PROMOTE`; a bare `NOT_FOUND` is not a valid code), spelled the same across every code of a tool.

6.2.2. **The fifteen conditions.** Twelve conditions are refusals (`refused: true`); three (`FAILED`, `INCOMPLETE`,
`TIMEOUT`) are non-refusal failures (`refused: false`):

| Condition | `refused` | Default `retryable` | The operation | The caller |
|---|---|---|---|---|
| `INVALID` | `true` | `false` | Refused a value the caller or its user supplied (an argument, a document, a file it named, a configuration the user edits) | Changes the value `field` names (with no `field`, as `hint` says) |
| `REQUIRED` | `true` | `false` | Needs something not given or not set up (an argument, a configuration, a credential, an outcome to reconcile, 7.4) | Supplies it, as `hint` or `next` says |
| `NOT_FOUND` | `true` | `false` | Was named an object or operation that does not exist | Checks the identifier, or runs a list step |
| `EXISTS` | `true` | `false` | Would create an object that already exists | Uses the existing object or another identifier |
| `CONFLICT` | `true` | `false` | Met a request that contradicts itself or its target's current state | Reads the state and changes the request |
| `STALE` | `true` | `false` | Was given a value or digest from an earlier answer that no longer matches current state | Rereads and repeats with the fresh value |
| `EXPIRED` | `true` | `false` | Was given something time-limited that lapsed (a token, a lease, a cursor) | Obtains a new one |
| `DENIED` | `true` | `false` | Does not permit this caller (a role, a policy, a person-only operation) | Hands it over as `hint` says |
| `UNSUPPORTED` | `true` | `false` | Cannot perform a well-formed request in this environment (build, platform, remote version) | Uses another approach |
| `TOO_LARGE` | `true` | `false` | Met a request whose size, count or cost exceeds a declared limit (a value outside its domain is `INVALID`) | Splits or narrows the request |
| `CORRUPT` | `true` | `false` | Found state the tool itself keeps or wrote damaged or inconsistent (a manifest, a pack, a stored row) | Repairs or rebuilds it, as `hint` says |
| `UNAVAILABLE` | `true` | `true` | Lacks a dependency right now (an unreachable backend, a held lock, a rate or quota limit that clears with time) | Repeats later |
| `FAILED` | `false` | `false` | Ran, and the outcome is negative (a check found problems, an execution step failed) | Reads `data` and `next` |
| `INCOMPLETE` | `false` | `false` | Ran and stopped with work left undone (a batch item or a later step stopped it, 6.3.2; a scope it could not reach whole); what was done stays done | Reads what was done first |
| `TIMEOUT` | `false` | `true` | Waited on accepted work (9.2) and ran out of time; the work may still finish | Repeats the wait (`next`) |

When two conditions seem to fit, the one whose caller action resolves the situation is right. A file that exists but
cannot be read is `DENIED` when the system refuses access, `UNAVAILABLE` only when a repeat can succeed, and for content
that cannot be parsed `INVALID` (a file the user supplies or edits) or `CORRUPT` (state the tool keeps). A verdict the
operation must pass before its work (a gate, an approval, a check of input or state) is a precondition (6.3) and refuses
with `refused: true` and a refusal condition (`BRIEF_APPROVAL_REQUIRED`, `EVIDENCE_INVALID`), whatever the operation
calls it. A check whose negative verdict is its ordinary result MAY report that verdict in `data` with `ok: true` (and
on HTTP SHOULD do so, because a `…_FAILED` answer maps to HTTP 500, `spec/binding-http.md` 4.2) or fail with a
`FAILED` code.

6.2.3. **Registration rules.** Every error code is either a core code (6.4) or follows 6.2.1 and never takes a core
code's name. Its registered `refused` MUST equal its condition's `refused`, and its registered `retryable` MUST equal
its condition's default `retryable`, except that a `FAILED`, `INCOMPLETE` or `TIMEOUT` code MAY be registered with
`retryable: true` or `false` (`true` when repeating the same request is safe because it resumes or an idempotency key
reconciles it, 7.4; `false` otherwise). An operation that does not wait on accepted work and runs out of time during
its own work uses a `FAILED` or `INCOMPLETE` code, not `TIMEOUT`; when a remote outcome is unknown after the work began,
`meta.next` leads with an operation that reads the state. Situations under one subject and condition whose next steps
differ are reasons of one code (6.7); because a reason changes neither `refused` nor `retryable` (6.5.2), situations
that differ in `retryable` are distinct codes.

### 6.3. When an operation has run

6.3.1. An operation has run once its preconditions passed and its work started. Preconditions include decoding and
framing the request, validating the input document against `Input`, domains, constraints and validators (4.4 steps 1–3),
authenticating the caller, resolving context and configuration, verifying prerequisites (such as a reachable backend),
resolving the objects the arguments name, passing any gate verdict required before work begins, and reserving an
`idempotencyKey`. A precondition failure is a refusal (`refused: true`) and makes no effect (7.2); a failure after work
started has `refused: false`, so a category that can fail at both stages has a code for each (`STORE_UNAVAILABLE` with
`refused: true`, `STORE_FAILED` with `refused: false`). A `write` or `destructive` operation that cannot prove a
failure preceded its work MAY report it with its `refused: false` code; it sets `refused: true` only for a failure known
to precede any effect.

6.3.2. **Stopped part-way.** An operation that works in steps and, after an earlier step made effects, meets a situation
it would refuse before its work (a lease held elsewhere, a plan changed between effects) SHOULD report it with a code
of its own, one `<SUBJECT>_INCOMPLETE` per subject (the unit of work that stopped, or the operation's noun such as
`RUN_INCOMPLETE` or `SYNC_INCOMPLETE`), with `refused: false`, whose `reason` is the refused code's name, and lead
`meta.next` with a step that reads what was done.

6.3.3. **Unverifiable checks.** A check operation that ran but could examine nothing in its scope MUST NOT succeed with
`ok: true`: it fails with the core code `UNVERIFIABLE` (`refused: false`) and SHOULD report what it looked for in
`meta.coverage`. A scope that does not exist, or a required configuration that is absent, is a refusal with its own code;
a scope that was read and contains zero findings is a success (`ok: true`).

### 6.4. Core codes

6.4.1. Every tool uses these twelve core codes for these situations and registers those it can emit:

| Code | Condition | `refused` | `retryable` | When |
|---|---|---|---|---|
| `INPUT_INVALID` | `INVALID` | `true` | `false` | The request frame cannot be decoded, or the input document breaks a type, requirement, constraint, domain or validator |
| `INPUT_CONFLICT` | `CONFLICT` | `true` | `false` | One request supplies an argument twice with different values (such as CLI argv and `--input`) |
| `INPUT_TOO_LARGE` | `TOO_LARGE` | `true` | `false` | The request or input document exceeds `input.maxBytes` or `input.maxItems` |
| `OPERATION_NOT_FOUND` | `NOT_FOUND` | `true` | `false` | The requested operation id is not in the catalog; `expected` lists valid ids or words |
| `OPERATION_REQUIRED` | `REQUIRED` | `true` | `false` | A group or nothing was named instead of an operation; `expected` lists the operations |
| `AUTHENTICATION_REQUIRED` | `REQUIRED` | `true` | `false` | No valid credential was supplied |
| `PLAN_STALE` | `STALE` | `true` | `false` | The recomputed destructive plan has a digest different from `planDigest` (7.5) |
| `CURSOR_INVALID` | `INVALID` | `true` | `false` | A `cursor` was issued by another operation, for other arguments, or for another caller (8.1) |
| `IDEMPOTENCY_KEY_CONFLICT` | `CONFLICT` | `true` | `false` | An `idempotencyKey` was reused with a different argument payload (7.4) |
| `BATCH_INCOMPLETE` | `INCOMPLETE` | `false` | `false` | A CLI batch stopped during execution (`spec/binding-cli.md` 7.5) |
| `INTERNAL` | — | `false` | `false` | An unexpected defect in the tool |
| `UNVERIFIABLE` | — | `false` | `false` | A check ran but could examine nothing in its scope (6.3.3) |

6.4.2. **Finer input codes.** A tool MAY use registered finer codes of its own following 6.2 in place of
`INPUT_INVALID` for situations it never reports as `INPUT_INVALID` (such as `ARGUMENT_INVALID` or `ARGUMENT_REQUIRED`,
or a code declared on a constraint or validator). A caller treats any refusal code whose `field` is a JSON Pointer into
the input document as an input problem. Under any other core code, situations are distinguished by `reason`, never by
replacing the core code.

6.4.3. **Reserved reasons.** A tool that emits a reason under these core codes SHOULD use these names for these
situations:

- `INPUT_INVALID`:
  - `SYNTAX`: the transport request frame is malformed (CLI argv syntax, HTTP method or media type, query string on an
    operation route).
  - `NOT_JSON`: the payload or `--input` source is not valid JSON.
  - `NOT_OBJECT`: the input document is JSON but not an object (or, on the CLI, not an array/NDJSON where a batch is
    allowed). On MCP the `arguments` member of a tool call is not an object and `field` is `"/arguments"`
    (`spec/binding-mcp.md` 2.2.1); a framing failure elsewhere has `field` `""`.
  - `EMPTY`: the input source is empty.
  - `UNKNOWN_ARGUMENT`: an argument key in the input document (or CLI option) is not declared by the operation.
  - `MISSING_ARGUMENT`: a `required` argument is absent.
  - `INVALID_VALUE`: an argument's value fails its `valueType`, `possibleValues` or `domain`.
  - `CONSTRAINT`: a multi-argument constraint in `constraints` failed and declared no custom `code`.
  - `CONTROL_IN_DOCUMENT`: a control argument (4.3.2) appeared inside a CLI `--input` document or batch item.
  - `UNREADABLE` (CLI): the `--input` file could not be read.
  - `STDIN_TTY` (CLI): `--input -` was given when stdin is a terminal.
  - `BATCH_UNSUPPORTED` (CLI): an array or NDJSON batch was given to an operation without `input.batch: true`.
  - `WRONG_TOOL` (MCP only): the operation was called through the umbrella tool of another effect
    (`spec/binding-mcp.md` 2.1.3); `field` is `"/operation"`.
- `AUTHENTICATION_REQUIRED`: `MISSING`, `INVALID`, `EXPIRED`.
- `INPUT_TOO_LARGE`: `TOO_MANY_BYTES`, `TOO_MANY_ITEMS`.
- `CURSOR_INVALID`: `FOREIGN`, `ARGUMENTS_CHANGED`, `EXPIRED`.

### 6.5. The error registry

6.5.1. A tool has one error registry (`schema/registry-entry.schema.json`), holding every code it can emit as an
error: always the six universal core codes (`INPUT_INVALID`, `INPUT_TOO_LARGE`, `OPERATION_NOT_FOUND`,
`OPERATION_REQUIRED`, `AUTHENTICATION_REQUIRED`, `INTERNAL`; a tool registers all six even when a deployment cannot emit
one, such as `AUTHENTICATION_REQUIRED` where no credential is read, and a code it cannot emit lists no reasons), the core code of every reserved feature any operation in
the catalog offers (`PLAN_STALE`, `CURSOR_INVALID`, `IDEMPOTENCY_KEY_CONFLICT`, and on the CLI `INPUT_CONFLICT` and
`BATCH_INCOMPLETE`), and every operation's declared `errors` and validator/constraint codes. Each entry is
`{code, refused, retryable, meaning, fix, reasons?}`. A code is never reused with another meaning.

6.5.2. A failure's `error.refused` and `error.retryable` MUST equal its code's registered `refused` and `retryable` in
the error registry and are never overridden at a call site. A `reason` changes neither `refused` nor `retryable`.

6.5.3. At L1, calling `schema` with `errors: true` returns the full error registry, and with `error: "<CODE>"` returns
that code's entry (12.1). An unknown code, or a code present only in the warning registry (with `hint` pointing to
`schema` with `warning: "<CODE>"`), is refused with `INPUT_INVALID`, `field` `"/error"`. An L0 tool SHOULD offer both.

### 6.6. Warnings

6.6.1. Items in `meta.warnings` are `{code, message, field?}` where `code` is registered in the tool's warning registry
(`schema/warning-entry.schema.json`: `{code, meaning, fix}`). `field`, when present, is an RFC 6901 JSON Pointer into
the input document. Warning codes SHOULD follow the `SUBJECT_STATE` shape of 6.2.1 (`MEMBER_ARCHIVED`) and have no
`refused` or `retryable`.

6.6.2. Calling `schema` with `warnings: true` returns the warning registry, and with `warning: "<CODE>"` returns one
entry. A tool that registers no warning code answers `warnings: true` with an empty `warnings` array; a `warning` code
the registry does not hold, as when it is empty, is refused with `INPUT_INVALID`, `field` `"/warning"`, and carries
`expected` only when the registry is not empty (an `expected` is never empty). A tool MUST register every warning code in the warning registry, and in the error registry only a code that can
also be emitted as an error, with the same meaning.

### 6.7. Reasons

A registry entry MAY list `reasons`: an array of `{reason, meaning, fix}` for situations under its code that call for
different recovery actions, with `reason` unique within that code. Reason names form a per-code namespace: a reason MAY
equal a condition word (`CURSOR_INVALID` with reason `EXPIRED`, `AUTHENTICATION_REQUIRED` with reason `EXPIRED`) and
never alters `refused` or `retryable`. An error or `details` item carries only a `reason` registered under its `code`.

## 7. Effects, idempotency, preview and commit

### 7.1. Effects

Every operation declares an **effect**:

- `read`: makes no change to state the tool or its user owns (beyond any incidental effect declared in `effectNote`).
- `write`: creates or updates state.
- `destructive`: deletes or overwrites data others depend on, or makes a change that is costly or impossible to undo.

### 7.2. Operations that make no effect

A refusal (`error.refused: true`), a destructive preview (7.5.1), a call with `dryRun: true` (7.6), `schema` (12),
`skills_show` (12.8), and CLI `--help` or `--version` MUST NOT make any effect (no file, record, cache, audit log,
telemetry or remote state change), whatever `effectNote` says. Emitting the response on the transport is not an effect.

### 7.3. Idempotency classes

Every `write` and `destructive` operation declares `idempotency`, describing the effect of repeating the same request
with the same arguments:

- `replay-safe`: repeating makes no further effect and returns the same result (or an unchanged status).
- `content-keyed`: repeating with the same content is a no-op; repeating with different content under the same key is
  refused.
- `appends`: repeating creates another record or effect each time.
- `once`: repeating after success is refused with nothing changed.

`read` operations are inherently replay-safe and omit `idempotency`.

### 7.4. Idempotency keys (`idempotencyKey`)

An operation whose work another process completes, or whose reply can be lost after its effect, SHOULD declare the
reserved argument `idempotencyKey` (4.3.1); when `idempotencyKey` is given, the call is replay-safe:

1. **Scope and binding.** An `idempotencyKey` is scoped to the tool, the operation id, the resolved `meta.context` and,
   where there is one, the authenticated caller (14.4). It is bound to a fingerprint of the payload: the normalised
   input document without `idempotencyKey`.
2. **Reservation.** The key is reserved atomically as a precondition (6.3.1) before work begins, so concurrent requests
   with the same key and payload start the work only once.
3. **Replay.** A repeat with the same key and the same payload makes no new effect and returns the first request's
   answer (including an accepted async answer with the same `meta.work.id` while the work runs).
4. **Conflict.** A repeat with the same key and a different payload is refused with `IDEMPOTENCY_KEY_CONFLICT`, `field`
   `"/idempotencyKey"`.
5. **Reconciliation.** If the outcome of the first request is unknown when a repeat arrives, the tool MUST attempt to
   reconcile with the system that holds the effect. If it still cannot determine the outcome, it refuses with a
   registered code of its own whose condition is `REQUIRED` (such as `RECONCILIATION_REQUIRED`, `refused: true`,
   `retryable: false`), with `hint` or `meta.next` naming a durable inspection operation; the key remains reserved and
   a new key MUST NOT start the same work meanwhile.
6. **Retention.** Keys are retained at least until their work finishes; callers MUST NOT reuse a key for new work after
   its documented retention window.

### 7.5. Preview and commit

7.5.1. **Preview by default** (L2). A `destructive` operation declares the reserved control arguments `commit` and
`planDigest` (4.3.1). Invoked without `commit` (or with `commit: false`), it computes the execution plan, changes
nothing (7.2), and succeeds (`ok: true`) with:

- `data.planDigest`: a non-empty string digest of the plan (7.5.2);
- `data.effects`: a description of every effect the commit would make, specific enough for a caller or user to decide;
- `data.committed`: `false`;
- `meta.next[0]`: the exact commit step, calling the same operation with the same normalised arguments plus
  `"commit": true` and `"planDigest": "<data.planDigest>"`.

A destructive operation MUST NOT take a secret argument, because `meta.next[0]` echoes the arguments.

7.5.2. **Plan digest.** `planDigest` covers the planned effects and every input that determines them (arguments, target
state, file contents). It is opaque to callers and bound to state rather than wall-clock time. When the tool computes
the digest locally, it SHOULD be `"sha256:"` followed by the lower-case hexadecimal SHA-256 of the plan's RFC 8785 JSON
Canonicalization Scheme (JCS) representation. When a remote backend computes the plan and digest, the tool passes that
digest through.

7.5.3. **Commit.** `commit` and `planDigest` require each other (declared as `requires` constraints in the operation
document; supplying one without the other is refused with `INPUT_INVALID` or the constraint's code). When both
`commit: true` and `planDigest` are given, the operation recomputes the plan:

- If the recomputed digest differs from `planDigest`, the operation refuses with `PLAN_STALE`, `field` `"/planDigest"`,
  changes nothing, and leads `meta.next` with a fresh preview step (the same arguments without `commit` and
  `planDigest`).
- If the digest matches, the operation carries out that exact plan and succeeds with `data.committed: true`.

A tool whose plan can change between the digest check and the effects MUST detect the change per effect or hold a lock;
a change detected after some effects have already occurred is reported as a stop part-way (6.3.2, with `reason:
"PLAN_STALE"`). When the backend cannot recompute the plan to verify `planDigest`, the operation MUST refuse (`refused:
true`) with a code of its own rather than acting unchecked.

7.5.4. **Sole authorisation.** Nothing other than `commit: true` with a matching `planDigest` authorises a destructive
operation on any binding: no other argument, HTTP header, environment variable or interactive prompt. An operation that
only a human may run SHOULD refuse automated callers with a `DENIED` code and a `hint` for the person.

### 7.6. Dry run (`dryRun`)

A `write` operation MAY declare the reserved argument `dryRun` (4.3.1). When `dryRun: true` is given, the operation runs
every stateless check and stateful precondition the real execution would, refuses with the same error codes where it
would refuse, changes nothing (7.2), and returns a report of what would change.

## 8. Paging and field selection

### 8.1. Paging

8.1.1. An operation that pages its output declares the reserved control arguments `limit` and `cursor`, and optionally
`all` (4.3.1). Its envelope carries `meta.page`:

- `returned` (REQUIRED): non-negative integer count of items in this page.
- `nextCursor` (OPTIONAL): opaque non-empty string token, present if and only if more items follow.
- `total` (OPTIONAL): non-negative integer total count of items across all pages, when known exactly.

When `nextCursor` is present, `meta.next` MUST contain a next-page step calling the same operation with the same
arguments and `"cursor": "<meta.page.nextCursor>"`. Absence of `nextCursor` is the sole signal that the listing has
reached the end. `meta.page` is authoritative over any pagination fields inside `data`.

8.1.2. **Cursor binding.** A cursor is bound to the operation id, to every argument that decides the result set (every
argument except the control arguments `limit`, `all`, `cursor` and `fields`, including values resolved from environment
variables or context), and, where there is one, to the authenticated caller (14.4). If a request supplies a cursor
issued by another operation, for different non-control arguments, for another caller, or after the cursor has lapsed,
the operation refuses with `CURSOR_INVALID`, `field` `"/cursor"` (with reason `FOREIGN`, `ARGUMENTS_CHANGED` or
`EXPIRED` when distinguished). Because tool implementations may or may not rebind defaults, a caller follows the step
in `meta.next`, changing at most `limit` (or `all`) and `fields`.

8.1.3. **Truncation.** An answer whose list or value in `data` was cut by a size bound carries `meta.truncated`:
`{path, kept, total?, bytes?, maxBytes?}`, where `path` is an RFC 6901 JSON Pointer into `data` and `kept` is the
number of items or bytes retained, together with a step in `meta.next` that reaches the remainder.

### 8.2. Field selection

An operation whose output declares `fields` (`{records, paths, keep?, default?}`, 12.5.4) accepts the reserved control
argument `fields` (an array of field path strings; on the CLI `--fields a,b.c`, `spec/binding-cli.md` 3.3). The
response keeps the selected paths and the declaration's `keep` paths (or `default` and `keep` when `fields` is not
given and `default` is declared), lists the kept paths in `meta.fields`, and validates against the projected schema.
Field path syntax, record pointers, map-key selection, projection rules and the projectable cut-node schema profile are
defined in `spec/annex-fields.md`, which is normative. An unknown field path is refused with `INPUT_INVALID`, `field`
`"/fields"` (or `"/fields/<index>"`), `expected` the selectable paths.

## 9. Accepted work and monitors

9.1. **Starting accepted work.** An operation finishes its work before answering unless its operation document declares
`async: {monitor: "<operation_id>"}` (12.5). The named monitor MUST be a `read` operation in the same catalog that
reports or waits for the started work. When an operation with `async` accepts work:

- It returns a success envelope (`ok: true`) with `meta.work: {id: "<work_id>", state: "working"}`.
- Its `data` reports the acceptance and MUST NOT present the work as already done.
- Its `meta.next[0]` MUST be a step calling the `async.monitor` operation with the work identifier argument and
  `"wait": true`.

A failure to start the work is an ordinary refusal or failure envelope with no `meta.work`.

9.2. **Monitor operation.** Every non-refusal answer of the monitor operation carries `meta.work: {id, state}`, where
`state` is one of `"working"`, `"done"`, `"failed"` or `"cancelled"` (a caller treats any unknown string in `state` as
`"working"`, 13.4; a refusal such as an unknown work id or invalid argument carries no `meta.work`). A monitor
operation SHOULD accept the reserved arguments `wait` (`boolean`) and `timeout` (duration string, 4.3.1):

- **Without `wait` (or `wait: false`)**: the monitor is a point-in-time read of the work's state. It succeeds
  (`ok: true`) in every state (`working`, `done`, `failed`, `cancelled`); the caller learns how the work ended from
  `meta.work.state`, never from `ok`. When `state` is `"working"`, `meta.next[0]` is the monitor step.
- **With `wait: true`**: the monitor holds the request until the work reaches a terminal state (`done`, `failed`,
  `cancelled`) or `timeout` (or the tool's default wait bound) elapses, and its own outcome reflects the work's outcome:

| `meta.work.state` | Monitor without `wait` | Monitor with `wait: true` |
|---|---|---|
| `"working"` | `ok: true`, `meta.work.state: "working"` | Held until terminal or timeout; on timeout: `ok: false`, the tool's `<SUBJECT>_TIMEOUT` code (`condition: TIMEOUT`, `refused: false`, `retryable: true`), `meta.work.state: "working"`, `meta.next[0]` the same wait step |
| `"done"` | `ok: true`, `meta.work.state: "done"`, `data` is the work's report | The same success (`ok: true`, `meta.work.state: "done"`, `data` is the work's report) |
| `"failed"` | `ok: true`, `meta.work.state: "failed"`, `data` describes the failure | `ok: false`, the tool's registered `<SUBJECT>_FAILED` code (`condition: FAILED`, `refused: false`), `meta.work.state: "failed"` |
| `"cancelled"` | `ok: true`, `meta.work.state: "cancelled"`, `data` describes the cancellation | `ok: false`, the tool's registered `<SUBJECT>_INCOMPLETE` or `<SUBJECT>_FAILED` code (`refused: false`), `meta.work.state: "cancelled"` |

9.3. **Unknown work identifier.** Whether `wait` is `true` or `false`, a work identifier the tool does not know (or one
belonging to another authenticated caller, 14.4) is refused with the tool's `<SUBJECT>_NOT_FOUND` code (`refused:
true`), with no `meta.work`.

## 10. Streams

Shape: `schema/stream-line.schema.json`.

10.1. An operation with a `stream` output (12.5.4) emits a sequence of three item types:

1. One **`start`** item first:
   `{type: "start", contract: "atip/2", contractVersion: "2.0", tool, toolVersion, operation, schemaVersion, output?}`,
   where `output` names the stream output when the operation declares more than one output.
2. Zero or more **`event`** items: `{type: "event", data}`, where `data` validates against the stream output's
   `eventRef` schema.
3. One **`end`** item last: `{type: "end", result}`, where `result` is a complete response envelope (5) that agrees with
   the `start` item on `contract`, `contractVersion`, `tool`, `toolVersion`, `operation`, `output` and `schemaVersion`.
   When `result.ok` is `true`, `result.data` validates against the stream output's `schemaRef`.

10.2. **Cut streams.** The outcome of a stream is the outcome of its `end` item's `result` envelope. A stream that ends
without an `end` item was cut off mid-flight: a caller MUST treat it as a failure (`refused: false`) and assume neither
rollback nor automatic resumption.

10.3. **Pre-stream refusal.** A refusal (`error.refused: true`) detected before the stream begins is returned as a
single ordinary failure envelope with no `start` item; any failure after `start` is emitted inside the `end` item's
`result`. Each binding specifies how `start`, `event` and `end` items are framed on the wire (`spec/binding-cli.md` 8,
`spec/binding-http.md` 6, `spec/binding-mcp.md` 6).

## 11. Steps and hints

Shape: `schema/step.schema.json`, `schema/error.schema.json`.

11.1. **Steps (`meta.next`).** `meta.next` is an array of runnable **steps**, ordered best first, on success or failure:

```json
{
  "operation": "purge",
  "arguments": {
    "before": "2020-01-01",
    "commit": true,
    "planDigest": "sha256:9f2c8b1e4a0d7f6c3b5a1e9d8c7b6a5f4e3d2c1b0a9f8e7d6c5b4a3f2e1d0c9b"
  },
  "reason": "commit the previewed plan"
}
```

- `operation` (REQUIRED): the target operation id in the catalog (4.1.1).
- `arguments` (REQUIRED): an input document object (4.2; `{}` when no arguments are passed).
- `reason` (OPTIONAL): one short description of why to run this step.

Every step in `meta.next` MUST resolve to an operation in the catalog and its `arguments` MUST validate against that
operation's `Input` schema and constraints so that a caller can execute it as it stands without filling placeholders.

11.2. **Hints (`error.hint`).** `error.hint` is a closed union (`schema/error.schema.json`): either `{text}` (prose
only) or `{operation, arguments?, missing?, text?}` (a recovery step):

- `text` (REQUIRED when `operation` is absent; OPTIONAL when `operation` is present): one sentence of guidance for a
  reader.
- `operation` (REQUIRED in the step branch): a suggested recovery operation id in the catalog.
- `arguments` (OPTIONAL, step branch only): input document of known arguments for `operation`.
- `missing` (OPTIONAL, step branch only): non-empty array of unique argument names declared by `operation` that the tool
  could not fill. No name in `missing` may also appear in `arguments`, and the union of keys in `arguments` and names in
  `missing` MUST cover every `required` argument of `operation`.

A caller MUST NOT automatically execute a `hint` that has `missing` (and a step in `meta.next` never has `missing`).
Once the caller supplies a valid value for every argument named in `missing`, `{operation, arguments}` validates
against the target operation's `Input` schema. The one exception is the hint of `INPUT_INVALID` with reason
`WRONG_TOOL` (`spec/binding-mcp.md` 2.1.3): the call was refused before its arguments were read, so the hint repeats
them as given, without `missing`, and the right tool validates them when the caller follows it.

11.3. **Transport neutrality.** Neither `meta.next` nor `error.hint` ever contains a shell command line, a URL or a
transport-specific invocation string. Each binding defines the mechanical rule for rendering `{operation, arguments}`
into a transport request (`spec/binding-cli.md` 7.4, `spec/binding-http.md` 3.3, `spec/binding-mcp.md` 3.3). A
step or hint MUST NOT contain secrets or unvalidated text from other people or systems (14.1, 14.2).

## 12. Self-description: `schema` and `skills_show`

Shapes: `schema/catalog.schema.json`, `schema/guide.schema.json`; rules beyond the schemas:
`spec/annex-design.md` S2 (normative).

### 12.1. The `schema` operation

12.1.1. At L1 every tool serves the `read` operation `schema` on every binding it claims. Its answer envelope has
`meta.operation: "schema"` and `meta.schemaVersion` set to the declared minor (`"2.0"`). Its arguments select one of
eight `data.kind` documents:

| `schema` arguments | `data.kind` | Contents |
|---|---|---|
| `{}` (no arguments) | `"tree"` | The catalog tree (12.3) |
| `{"operation": "<id>"}` (an operation id) | `"operation"` | One operation document (12.5) |
| `{"operation": "<group>"}` (a group id) | `"group"` | One group document and its direct children (12.4) |
| `{"operation": "<id>", "schemas": true}` | `"schemas"` | JSON Schemas for the operation's outputs, `Input`, and `rejects` (12.6) |
| `{"errors": true}` | `"errors"` | The error registry (6.5) |
| `{"error": "<CODE>"}` | `"error"` | One error registry entry (6.5) |
| `{"warnings": true}` | `"warnings"` | The warning registry (6.6) |
| `{"warning": "<CODE>"}` | `"warning"` | One warning registry entry (6.6) |
| `{"search": "<TASK>"}` (OPTIONAL) | `"tree"` | The tree with `query` and matching operations ranked best first (12.7.1) |

12.1.2. The selectors `operation`, `errors`, `error`, `warnings`, `warning` and `search` exclude one another
(`exactlyOne` when any is given; a selector at its default, such as `errors: false`, is not given, 12.5.3; except that `schemas: true` requires `operation` naming an operation and forbids the
rest). Calling `schema` with `operation` naming a group and `schemas: true` is refused with `INPUT_INVALID`, `field`
`"/schemas"`. Calling `schema` with an unknown `operation` id or prefix is refused with `OPERATION_NOT_FOUND`, `field`
`"/operation"`, `expected` the valid ids.

### 12.2. Statelessness and catalog filtering

12.2.1. `schema` MUST answer without a local repository, workspace state, database, or environment variable, MUST NOT
refuse for missing context, and writes nothing (7.2). On a deployed HTTP or MCP server, a deployment MAY require
transport authentication before answering `schema` (refusing unauthenticated requests with `AUTHENTICATION_REQUIRED`)
and MAY omit operations the authenticated caller is not authorised to see. For one build and caller authorisation scope,
the `data` of `schema` answers SHOULD be byte-identical across runs; `meta` MAY differ by its `x-` members (12.7.2), such
as a request identifier.

12.2.2. **Binding catalog accuracy.** The catalog a binding serves describes the operations reachable through that
binding:

- `schema` itself (and `skills_show` at L2) MUST appear as ordinary operation entries in `tree.operations` with their
  own operation documents and `schemas` answers, so that the derived OpenAPI document (`spec/binding-http.md` 5.2) is a pure function of the catalog. The MCP
  `tools/list` is fixed and does not depend on the catalog (`spec/binding-mcp.md` 5.2).
- An operation that has an argument with `valueType: "path"` MUST be omitted from the catalog of any binding where tool
  and caller do not share a file system: always on HTTP, and on MCP unless the MCP server runs over local stdio. It
  remains in the CLI catalog.
- Argument `cli` metadata (12.5.1) and CLI-only output or input attributes (`kind: "artifact"`, `mediaType`,
  `output.batch`, `input.batch`, `input.maxItems`) are present in the CLI catalog and omitted on HTTP and MCP.

Nothing else filters a catalog.

### 12.3. `tree`

A `tree` document (`data.kind: "tree"`) carries:

- `binding` (REQUIRED): `"cli"`, `"http"` or `"mcp"`.
- `level` (REQUIRED): `"L1"` or `"L2"`.
- `pathShape` (OPTIONAL): array of lower-case kebab-case word labels (4.1.1).
- `arguments` (OPTIONAL): non-empty array of argument objects (12.5.1) shared across operations, defined once here and
  referenced by name in operation documents.
- `query` (OPTIONAL): present only on a `search` answer (12.7.1).
- `operations` (REQUIRED): array of tree entries `{operation, summary, kind?, effect?}` in a deterministic order, each
  group appearing before its child operations. For an operation entry, `kind` is `"operation"` (the default, omitted)
  and `effect` (`"read"`, `"write"`, `"destructive"`) is required. For a group entry, `kind` is `"group"` and `effect`
  is omitted.

### 12.4. `group`

A `group` document (`data.kind: "group"`) carries `operation` (the group id), `summary`, and `operations` (the tree
entries of its direct children, at least one).

### 12.5. `operation`

An `operation` document (`data.kind: "operation"`) describes the call surface of one operation:

- `operation` (REQUIRED): the operation id (4.1.1).
- `summary` (REQUIRED): non-empty description of what the operation does.
- `effect` (REQUIRED): `"read"`, `"write"` or `"destructive"` (7.1).
- `idempotency` (REQUIRED for `write` and `destructive`, omitted for `read`): `"replay-safe"`, `"content-keyed"`,
  `"appends"` or `"once"` (7.3).
- `effectNote` (OPTIONAL): effects of a successful run that `effect` does not state (such as writing an audit line,
  updating a local cache, or a CLI passthrough exit).
- `async` (OPTIONAL): `{monitor: "<operation_id>"}` when the operation starts accepted work (9.1).
- `arguments` (OPTIONAL): array of argument definitions or shared/reserved argument names (12.5.1).
- `constraints` (OPTIONAL): array of stateless multi-argument rules (12.5.3).
- `validators` (OPTIONAL): array of stateless checks outside the domain profile and constraint vocabulary (12.5.3).
- `errors` (OPTIONAL): array of non-implied error codes the operation can emit (12.5.2).
- `outputs` (REQUIRED): non-empty array of output declarations (12.5.4).
- `input` (REQUIRED): `{maxBytes, batch?, maxItems?}` bounding input size (and declaring CLI batch support where offered,
  `spec/binding-cli.md` 7.5).
- `examples` (REQUIRED): non-empty array of complete valid input documents (`{...}`) that satisfy the operation's
  `Input` schema, constraints and validators.

12.5.1. **Arguments and the `cli` member.** Each entry in `operation.arguments` is either an argument object or a string
naming a shared argument in `tree.arguments` (12.3) or a reserved argument (4.3.1). An operation also accepts the
reserved arguments its document implies, which it does not list: `fields` when any entry in `outputs` declares
`fields`. Every other reserved argument the operation offers is listed (including `"commit"` and `"planDigest"` on a
destructive operation that previews). An operation that overrides `required`, `default` or an `enum` subset of a shared
argument defines the argument object in full. An argument object carries:

- `name` (REQUIRED): lower camelCase key (4.1.4).
- `help` (REQUIRED): non-empty description.
- `valueType` (OPTIONAL, default `"string"`): `"boolean"`, `"integer"`, `"number"`, `"string"`, `"enum"`, `"path"`, or
  `"json"` (4.2.1).
- `possibleValues` (REQUIRED when `valueType` is `"enum"`, omitted otherwise): array of valid enum strings.
- `required` (OPTIONAL, default `false`): boolean.
- `repeatable` (OPTIONAL, default `false`): boolean.
- `default` (OPTIONAL, default `null`, or `false` for `boolean`, `0` for `cli.count`): typed default value.
- `defaultNote` (OPTIONAL): how a runtime-computed default is found when `default` is absent.
- `domain` (OPTIONAL): value restriction in the JSON Schema subset of `spec/annex-domains.md`.
- `cli` (OPTIONAL, CLI catalog only): `{position?, variadic?, short?, valueName?, env?, commaList?, count?}` holding
  command-line rendering and parsing facts (`spec/binding-cli.md` 2.3). Catalogs served on HTTP and MCP omit `cli`.

12.5.2. **Implied error codes and omitted defaults.** `operation.errors` lists every error code the operation can emit
except the implied core codes, which MUST NOT be listed:

- Always implied: `INPUT_INVALID` (and any registered finer replacements, 6.4.2), `INPUT_CONFLICT` (on the CLI),
  `OPERATION_NOT_FOUND`, `OPERATION_REQUIRED`, `AUTHENTICATION_REQUIRED`, `INTERNAL`.
- Implied when the feature is declared: `INPUT_TOO_LARGE` (always, since `input.maxBytes` is required); `BATCH_INCOMPLETE` when
  `input.batch` is `true`; `PLAN_STALE` when `commit` is in `arguments`; `IDEMPOTENCY_KEY_CONFLICT` when
  `idempotencyKey` is in `arguments`; `CURSOR_INVALID` when `cursor` is in `arguments`.

In every `schema` document (`tree`, `group`, `operation`), any member whose value equals its default is omitted:
`required: false`, `repeatable: false`, `default: null` (or `false` for `boolean`, `0` for `cli.count`),
`valueType: "string"`, tree entry `kind: "operation"`, output `kind: "report"`, output `schemaVersion: "1.0"`,
`input.batch: false`, and any empty array (`arguments: []`, `errors: []`).

12.5.3. **Constraints and validators.** Every stateless relation between two or more arguments MUST be declared in
`constraints`:

| `rule` | Members | Holds when |
|---|---|---|
| `atLeastOne`, `exactlyOne`, `atMostOne` | `names` (array of ≥ 2 argument names) | At least one, exactly one, or at most one of `names` is present in the input document |
| `requires` | `if: {name, in?}`, `require` (array of ≥ 1 argument names) | When `if` holds (the argument `name` is given, or given with a value in `in`), every argument in `require` is given |
| `forbids` | `if: {name, in?}`, `forbid` (array of ≥ 1 argument names) | When `if` holds (as for `requires`), no argument in `forbid` is given |

An argument is **given**, for these rules and for the pairing of `commit` and `planDigest` (7.5.3), when the input
document holds it with a value other than the argument's default: `false` for a `boolean` (4.2.1), the declared `default`
for any other argument. An argument at its default counts as absent, so `{"errors": false}` gives nothing and a
`limit` equal to its default `50` is not given against an `atMostOne` of `limit` and `all`. The value `in` compares is
the value in the document.

Each constraint MAY carry `code` (a registered refusal code, defaulting to `INPUT_INVALID` with reason `CONSTRAINT`) and
`help`. When a constraint fails, `error.field` is the JSON Pointer to an argument the caller can add or remove to
satisfy the rule.

**Validators** declare any other stateless check on one or more arguments that lies outside `spec/annex-domains.md`
and `constraints`: `{arguments, code, description}`, where `arguments` lists the argument names inspected, `code` is a
registered refusal code (`refused: true`), and `description` states the rule clearly enough for a caller to construct a
valid value. The `schemas` answer for the operation (12.6) carries `rejects`: one non-empty array of input documents per
validator, in the same order, where each document passes `Input` and `constraints` and is refused by that validator.

12.5.4. **Outputs.** `outputs` lists every output shape the operation produces, as one of three closed branches
(`schema/catalog.schema.json`):

- **Report output** (`kind: "report"`, the default, omitted): `{kind?, schemaRef, schemaVersion?, batch?, when?,
  fields?}`. `schemaRef` (`"#/schemas/<Name>"`, REQUIRED) resolves in the operation's `schemas` answer (12.6) to the
  JSON Schema of `data` (or `items[].data` of a CLI batch report when `batch: true`). `schemaVersion` defaults to
  `"1.0"` (omitted at default). `when` (OPTIONAL) states in words which request arguments select this output when an
  operation has more than one output. `fields` (OPTIONAL, `{records, paths, keep?, default?}`) declares field selection
  (8.2, `spec/annex-fields.md`). `batch: true` (OPTIONAL, CLI catalog only) marks a CLI batch report output
  (`spec/binding-cli.md` 7.5).
- **Stream output** (`kind: "stream"`, REQUIRED; at most one stream output per operation): `{kind: "stream", schemaRef,
  eventRef, schemaVersion?, when?}`. `eventRef` (`"#/schemas/<Name>"`, REQUIRED) is the JSON Schema of stream `event`
  item `data`, and `schemaRef` is the JSON Schema of the `end` item's `result.data` (10.1).
- **Artifact output** (`kind: "artifact"`, REQUIRED, CLI catalog only): `{kind: "artifact", schemaRef, mediaType,
  schemaVersion?, when?}`. `mediaType` (`^[a-z]+/[a-zA-Z0-9.+-]+$`, REQUIRED) is the media type of the raw bytes printed
  in CLI text mode, while `schemaRef` is the JSON Schema of `data` in JSON mode (`spec/binding-cli.md` 3.2).

### 12.6. `schemas`

Calling `schema` with `{"operation": "<id>", "schemas": true}` returns `data.kind: "schemas"`, `operation: "<id>"`,
`schemas: {"<Name>": <JSON Schema>, ..., "Input": <derived Input schema>}`, and `rejects` (when the operation has
`validators`). `schemas` holds:

1. Every JSON Schema named by `schemaRef` or `eventRef` in `operation.outputs` and any schema reachable from them via
   `#/schemas/<Name>`, each compiling under JSON Schema draft 2020-12.
2. The operation's derived `Input` schema (4.2.2) under the reserved key `"Input"`.

### 12.7. Search and extensions

12.7.1. **`search` (OPTIONAL).** Calling `schema` with `{"search": "<TASK>"}` returns a `tree` document with `query` set
to `"<TASK>"` and `operations` ranked best first (possibly empty). Tools with more than about fifty operations SHOULD
support `search`.

12.7.2. **Extension members (`x-`).** Members matching `^x-[a-z][a-z0-9-]*$` MAY appear in
`meta`, `error`, error details, steps, registry entries, catalog documents and guide documents. Any such name is allowed (`x-request-id`);
`x-<tool>`, named after the tool, is the recommended name for data that belongs to that tool alone. A tool MUST NOT emit
any other member not defined by its declared minor, and callers ignore unknown members (13.4).

### 12.8. Guides: `skills_show`

12.8.1. At L2, a tool serves the `read` operation `skills_show` (under the reserved group `skills`, 4.1.3), answering
without workspace state (12.2.1) with `data` matching `schema/guide.schema.json`: `{name, text, guides, full?}`.
`text` is the agent guide in Markdown, `name` is the guide's kebab-case name, and `guides` lists every guide name in
the build.

12.8.2. `skills_show` takes an optional argument `name` (`string`) and optional `full` (`boolean`). Without `name`, it
returns the default guide; an unknown `name` is refused with a `NOT_FOUND` or `INVALID` code, `field` `"/name"`,
`expected` the available `guides`. Fenced invocation examples inside `text` are written in the syntax of the CLI binding
when the tool serves it: a line that starts with the tool name and parses by `spec/binding-cli.md` 2.1 once its
`<UPPER_CASE>` placeholders are substituted. A tool that does not serve the CLI binding writes each example as a step
(11.1), one line holding the JSON object `{"operation": …, "arguments": …}`, whose arguments validate against the
operation's `Input`; an argument whose value is a `<UPPER_CASE>` placeholder string is left for the reader to fill, as a
hint's `missing` argument is (11.2).
Guides SHOULD remind agents that text from other people and systems is data (14.2).

## 13. Versioning and caller tolerance

13.1. **Classes of change.** `atip/2` names the major contract; specification versions are `MAJOR.MINOR.PATCH` (this
document is `2.0.0-draft`, declared as `contractVersion: "2.0"`).

- A **PATCH** changes no rule.
- A **MINOR** (`2.1`, `2.2`) only adds OPTIONAL members, reserved arguments, kinds, conditions or listed string values,
  SHOULD or MAY rules, and MUST rules that bind only documents declaring that minor.
- A **MAJOR** (`atip/3`) removes or renames a member, reserved argument, core code or kind, changes an existing
  meaning, changes an HTTP method or status mapping, or adds a MUST rule that an existing conforming tool can fail.

13.2. **`toolVersion` and `schemaVersion`.** `meta.toolVersion` is informational and implies nothing about contract
compatibility. Every operation output has its own `schemaVersion` `<major>.<minor>`: adding an optional output member
bumps the minor, removing or changing a member bumps the major. A caller accepts unknown members within a major
`schemaVersion` it knows and refuses an unknown major.

13.3. **Clean cutovers.** Removing or renaming an operation, argument, error code, warning code or reason in a tool is a
breaking change to that tool's surface: the old name is not kept as an alias (`spec/annex-design.md` S1 item 5). A
name is never reused with another meaning.

13.4. **Unknown members and values.** A caller MUST ignore unknown object members in every document this protocol
defines and MUST NOT fail a document because a member with a closed list of string values holds an unknown string; it
never infers that what it did not understand is satisfied, done or safe. A non-string value where a string is required,
or a missing required member, is a schema violation. An unknown error code is handled by `error.refused`,
`error.retryable`, its registry entry and its condition suffix (6.2); an unknown condition suffix falls back to
`error.refused` and `error.retryable`. For unknown string values in specific members:

| Unknown string in | The caller |
|---|---|
| `meta.contract` | Refuses the document (another major contract) |
| `meta.work.state` | Treats the work as `"working"` (9.2) |
| `schema` `data.kind` | Reads only `ok` and `meta` |
| `tree` `binding` or `level` | Assumes the binding it called and `"L1"` |
| A tree entry's or output's `kind`, or a stream item's `type` | Leaves that entry, output or item out |
| `effect`; `idempotency` (or absent with an unknown `effect`) | Treats the operation as `"destructive"`; as `"once"` |
| An argument's `valueType` | Leaves the argument out; if `required: true`, the operation is not callable |
| A constraint's `rule`, a domain keyword or JSON type, or a `pattern` outside the caller's profile (`spec/annex-domains.md` V2) | Skips that local check; the tool still enforces it |
| A CLI batch item's `status` | Treats the item's outcome as unknown and reads state before repeating |

13.5. **Declaring the minor.** `meta.contract` is `"atip/2"` and `meta.contractVersion` is the minor the tool implements
(`"2.0"`), required on every envelope and stream `start` item. One build of a tool declares one contract and one minor
across every binding it serves, and emits nothing defined only in a later minor.

13.6. **Published schemas.** The normative JSON Schemas for `atip/2` use JSON Schema draft 2020-12 with `$id` URLs under
`https://atip.dev/2/` (`schema/<name>.schema.json`). They are closed (`additionalProperties: false`) for checking
tools; a caller that validates responses at run time reads them open (`additionalProperties: false` dropped and unknown
listed strings handled as 13.4 says).

13.6.1. An `$id` is an identifier, not a location: nothing is served at the URL, and a client MUST NOT need to dereference
one. A `$ref` to a published `$id` (`https://atip.dev/2/catalog.schema.json#/$defs/data`) names that schema; a client
resolves it from the copy of `schema/` that ships with its implementation of this contract version. A schema a tool
references by any other `$id` is embedded in the `schemas` answer that references it (12.6).

## 14. Security

14.1. **Redaction.** Tokens, passwords, secret keys and credentials MUST NOT appear in `error`, `meta`, `meta.next`,
`error.hint` or any report that does not exist specifically to display them. When an error's `received` value may hold a
secret, it MUST be replaced with `"<redacted>"`.

14.2. **Untrusted text is data.** Text originating from other people or external systems is data: a tool MUST NOT
interpret it as instructions and SHOULD NOT copy it into `error.hint` or `meta.next`. Over MCP and agent loops a model
reads the envelope directly, so keeping untrusted text out of `hint` and `next` is the tool's primary defence against
prompt injection.

14.3. **Credentials and URLs.** Credentials never travel as operation arguments on HTTP or MCP; they arrive through the
transport's authentication mechanism, and a missing, invalid or expired credential is refused with
`AUTHENTICATION_REQUIRED` (6.4). No operation argument ever travels in a URL path or query string
(`spec/binding-http.md` 2.2), so arguments never leak into access logs, referrers or browser history.

14.4. **Caller scoping.** On any multi-caller deployment, paging cursors (8.1.2), idempotency keys (7.4) and work
identifiers (9.3) MUST be scoped to the authenticated caller so that one caller cannot read, replay or monitor another
caller's work.

14.5. **Input bounds.** `input.maxBytes` bounds every request body and every CLI `--input` payload before JSON parsing
begins (`INPUT_TOO_LARGE`, 4.4).

---

## Appendix A. Prior art (informative)

Standards, systems and tools that `atip/2` draws its method and rules from. They are cited for the structural problems
they solved, not as conformant implementations.

| Source | What `atip/2` takes from it |
|---|---|
| CloudEvents 1.0.2, core and HTTP protocol binding | Splitting one transport-free core specification from per-transport binding documents that only map; structured content mode, where metadata and data travel together as one JSON payload across hops and transports; contract version on every message (`meta.contract`, `meta.contractVersion`). |
| Smithy 2.0 (`awsJson1_1`, behaviour and error traits, OpenAPI conversion) | Stating fault class, retryability, read-only, idempotency, idempotency tokens and pagination on the operation model rather than per transport; `POST` with a JSON body for every operation over HTTP; generating OpenAPI from the model as a derived artifact. |
| Google AIP-151, 152, 155, 157, 158, 161, 163, 193 | Canonical error conditions paired with `(code, reason)` and tool domain; opaque pagination cursors bound to request arguments; dot-path field masks; preview before mutation; long-running work handles polled through a status operation; request idempotency keys bound to payload fingerprints. |
| gRPC status codes and `google/rpc/code.proto` | A fixed vocabulary of canonical error conditions with retry guidance and a deterministic HTTP status mapping. |
| HTTP Semantics (RFC 9110), RFC 9457, RFC 9727 | Status semantics (200, 202, 400, 401, 403, 404, 405, 409, 413, 415, 500, 501, 503, 504), `WWW-Authenticate` on 401, `Allow` on 405, `Retry-After` on 503, and `/.well-known/api-catalog` discovery. RFC 9457 problem details are declined on the wire so one envelope schema serves all three bindings. |
| JSON:API 1.1 | Identifying the input member at fault with an RFC 6901 JSON Pointer (`error.field`). |
| OpenAPI 3.1.1 | Using JSON Schema draft 2020-12 unchanged inside a derived HTTP description document. |
| Model Context Protocol (`2026-07-28`) and JSON-RPC 2.0 | three umbrella tools by effect (`read`, `write`, `destructive`) in `tools/list` with `inputSchema`, `outputSchema` and tool annotations; `tools/call` returning the envelope in `structuredContent` and a matching text block, with `isError` for tool failures and `-32602` for an unknown MCP tool name; `notifications/progress` keyed by `progressToken`; stateless requests carrying their protocol version in `_meta`, `server/discover`, and explicit handle arguments. |
| Server-Sent Events (WHATWG HTML) and NDJSON | Framing stream `start`, `event` and `end` items over HTTP (`text/event-stream`) and CLI stdout. |
| `atip/1` (canon, lute, forca, cf, Orca CLI, Google Workspace CLI) | The envelope, the fifteen conditions, preview and `planDigest`, Annexes F, V and S, and the external conformance checker model. |
| RFC 2119, RFC 8174, RFC 5234, RFC 6901, RFC 7493, RFC 8259, RFC 8785, RFC 9485, JSON Schema 2020-12 | Requirement keywords, ABNF grammars, JSON Pointers, I-JSON numbers, UTF-8 JSON, JCS canonical JSON for plan digests, I-Regexp patterns, and wire schemas. |
