> ## Documentation Index
> Fetch the complete documentation index at: https://docs.agentlinkops.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Prepare placement context

> Extract physical occurrences from the current retained source capture.

`prepare_placement_context`

Extract physical occurrences from the current retained source capture. No network or model request. Requires the current project classification revision; expired, changed or incomplete source evidence fails closed.

<Note>Development preview. This command is absent from the verified deployed bundle. Use a matching development environment.</Note>

| Access | Behavior |
| - | - |
| `watches:read`, `classification:write` | Writes or admits work |

This operation changes saved state. Review its inputs and retry behavior before calling.

## Example request

Connect through [MCP](/guides/connect-mcp), [CLI](/guides/connect-cli), or [HTTP](/guides/connect-http). Replace example identifiers with records from your workspace.

<CodeGroup>
  ```json MCP theme={null}
  {
    "jsonrpc": "2.0",
    "id": 1,
    "method": "tools/call",
    "params": {
      "name": "prepare_placement_context",
      "arguments": {
        "watchId": "watch_example",
        "expectedRevision": 0
      }
    }
  }
  ```

  ```bash CLI theme={null}
  agentlinkops call prepare_placement_context --args '{"watchId":"watch_example","expectedRevision":0}'
  ```

  ```bash HTTP theme={null}
  curl "$AGENTLINKOPS_API_URL/v1/commands/prepare_placement_context" \
    -H "Authorization: Bearer $AGENTLINKOPS_API_KEY" \
    -H 'Content-Type: application/json' \
    --data '{"watchId":"watch_example","expectedRevision":0}'
  ```
</CodeGroup>

## Returned result

Illustrative data validated against the documented response schema. IDs and dates are examples, not a live account capture. MCP returns this data in `structuredContent` and in a text content block; generic HTTP and CLI return the JSON result directly.

```json theme={null}
{
  "version": "placement-context-v1",
  "binding": {
    "workspaceId": "workspace_example",
    "projectId": "project_example",
    "watchId": "watch_example"
  },
  "revision": 0,
  "applicability": "unavailable",
  "reason": "no_retained_classification",
  "summary": {
    "kind": "unclassified",
    "count": 0,
    "role": null
  },
  "occurrences": [],
  "capability": {
    "suggestionsAvailable": false,
    "reason": "provider_admission_required"
  }
}
```

## Input fields

Omit optional fields when you do not want to supply them. Null is accepted only where listed. Unknown input properties are rejected.

| Field | Type | Presence | Meaning and constraints |
| - | - | - | - |
| `watchId` | string | Required | Identifier of the watch returned by its create or list operation. minLength: 1; maxLength: 200 |
| `expectedRevision` | integer | Required | Revision last read by the caller; mismatches reject concurrent updates. minimum: 0; maximum: 9007199254740991 |

### Validation and omitted values

Explicitly extracts physical link occurrences from one complete retained HTML capture. It does not fetch a page, invoke a model or assert rendered visibility.

Link presence, Google index evidence, source authority and customer acquisition records remain independent of classification.

Current retained evidence, project access and the classification revision govern writes. An expired or changed source cannot authorize a current label. Existing keys and grants do not silently gain classification:write.

## Output fields

Fields inside optional or nullable parents apply only when that parent exists. [Common schema conventions](/reference/schemas) explain evidence states, empty lists and extensions.

* **`version`** (string, required): must equal "placement-context-v1"
* **`binding`** (object, required): additional fields rejected
* **`revision`** (integer, required): Optimistic concurrency revision; supply it as expectedRevision on the next write. minimum: 0; maximum: 9007199254740991
* **`applicability`** (string, required).
* **`reason`** (string / null, required): Recorded explanation; null when no explanation applies.
* **`summary`** (object, required): Grouped change counts included in this delivery, limited to accessible websites.
* **`occurrences`** (array, required).
* **`capability`** (object, required): additional fields rejected

<Accordion title="All fields and nested objects">
  | Field | Type | Presence | Meaning and constraints |
  | - | - | - | - |
  | `version` | string | Required | must equal "placement-context-v1" |
  | `binding` | object | Required | additional fields rejected |
  | `binding.workspaceId` | string | Required | Identifier returned by the related operation. minLength: 1; maxLength: 200 |
  | `binding.projectId` | string | Required | Identifier returned by the related operation. minLength: 1; maxLength: 200 |
  | `binding.watchId` | string | Required | Identifier returned by the related operation. minLength: 1; maxLength: 200 |
  | `revision` | integer | Required | Optimistic concurrency revision; supply it as expectedRevision on the next write. minimum: 0; maximum: 9007199254740991 |
  | `applicability` | string | Required | |
  | `reason` | string / null | Required | Recorded explanation; null when no explanation applies. |
  | `summary` | object | Required | Grouped change counts included in this delivery, limited to accessible websites. |
  | `summary.kind` | string | Required | |
  | `summary.count` | integer | Required | minimum: 0; maximum: 9007199254740991 |
  | `summary.role` | string / null | Required | |
  | `occurrences` | array | Required | |
  | `occurrences[].id` | string | Required | Resource identifier returned by the operation. pattern: "^sha256:\[a-f0-9]\{64}\$" |
  | `occurrences[].captureId` | string | Required | Identifier returned by the related operation. minLength: 1; maxLength: 200 |
  | `occurrences[].revision` | integer | Required | Optimistic concurrency revision; supply it as expectedRevision on the next write. minimum: 0; maximum: 9007199254740991 |
  | `occurrences[].evidenceHash` | string | Required | pattern: "^sha256:\[a-f0-9]\{64}\$" |
  | `occurrences[].axes` | object | Required | |
  | `occurrences[].axes.&#123;property&#125;.value` | string / null | Required | |
  | `occurrences[].axes.&#123;property&#125;.state` | string | Required | Saved lifecycle or evidence state, as enumerated for this record. |
  | `occurrences[].passages` | array | Required | |
  | `occurrences[].passages[].id` | string | Required | Resource identifier returned by the operation. |
  | `occurrences[].passages[].text` | string | Required | |
  | `occurrences[].canCorrect` | boolean | Required | |
  | `capability` | object | Required | additional fields rejected |
  | `capability.suggestionsAvailable` | boolean | Required | |
  | `capability.reason` | string / null | Required | Recorded explanation; null when no explanation applies. |
</Accordion>

[Download input schema](/schemas/prepare_placement_context.input.json) · [Download output schema](/schemas/prepare_placement_context.output.json)

## Errors and retries

This command is not annotated idempotent. After a timeout, inspect existing state before repeating a write. Operation-specific errors include `CLASSIFICATION_PRECONDITION_CHANGED`, `CLASSIFICATION_EVIDENCE_EXPIRED`, `CLASSIFICATION_ACCESS_DENIED`.

See [error recovery](/reference/errors) for status, scope, cooldown, cursor and retry handling. Unknown observations are result data and do not establish loss.

## HTTP resource routes

These existing resource routes share the operation’s domain behavior. Their parameter placement, status and response envelope can differ from generic invocation. See [HTTP route details](/reference/http/routes).

| Method and route | Success | Details |
| - | - | - |
| `POST /v1/watches/{watchId}/classification/prepare` | 200 | Explicitly extracts physical link occurrences from one complete retained HTML capture. It does not fetch a page, invoke a model or assert rendered visibility. |

## Continue

[get\_placement\_context](/reference/commands/get_placement_context)

Follow the [related workflow](/guides/monitor-changes), inspect [capability status](/capability-status), or return to the [command index](/reference/index).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.