# land_check

> Release: 0.11.0 · Last changed: 2026-11-09 · Source: https://github.com/KeiaiLab/SwarmOps/blob/stable/docs/reference/mcp-tools/land-check.md

Says what landing changes (1 to 32, each a head with an optional base and idempotency\_key) in order onto target, main by default, would come to, each merged onto what the clean ones before it make, as land would land them one after another: clean (the root tree it lands and the paths it changes), replayed, nothing\_to\_land, or conflict (land's E\_CONFLICT report). Writes nothing. Land with expect\_target set to onto to land what it found, or nothing.

```yaml
title: "land_check"
description: "Check a land."
since: "0.11.0"
mutates: false
identity_required: false
cli_command: "swarmops land-check"
envelope_op: "land_check"
request_type: "LandCheckReq"
annotations: {"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":true}
max_result_chars: null
```

## Input schema

`arguments` is a `LandCheckReq`: `swarmops schema LandCheckReq` prints the type. A field the type does not know is ignored.

| Field | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `changes` | array of object | yes |  | The changes, in the order they would land: 1 to 32 (`E_INVALID_ARG` for none, `E_TOO_LARGE` past 32), each key once. |
| `max_conflict_bytes` | integer | no | `32768` | The most bytes of hunk text each conflicting change's report carries, as a land's. |
| `target` | string | no | `"main"` | The ref the changes would land on: `main` or `release/<name>`, which must exist. |

### JSON Schema

As `tools/list` gives it: each `$ref` replaced by its definition, so that it stands alone.

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "description": "`land_check` (CLI `land --dry-run`, `land-check`): what landing `changes`, in order, onto\n`target` would come to, each after the clean ones before it, as `land` would land them one\nafter another. It writes nothing and takes no lock. A head or base not found, a base that\nis no ancestor, a merge in a chain or a key used for another change fails the whole check,\nas it fails a land.",
  "properties": {
    "changes": {
      "description": "The changes, in the order they would land: 1 to 32 (`E_INVALID_ARG` for none,\n`E_TOO_LARGE` past 32), each key once.",
      "items": {
        "description": "One change of a `land_check`: as `land` takes it.",
        "properties": {
          "base": {
            "anyOf": [
              {
                "description": "A revision as the caller wrote it, for the store to resolve: a ref name (`main`,\n`release/1.2`), a full 64-hex changeset id or a unique prefix of at least 12 hex digits, or a\nref's earlier value: `<ref>@{N}` the value it held N moves before its current one (`@{0}`\nis the current value), `<ref>@{at=<unix seconds>}` the value set by its newest move\nrecorded at or before that instant (the writer's clock, moves read in journal order);\noptionally followed by `~N` for the N-th first-parent ancestor.",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Where the change starts, as a land's `base`. When omitted, the merge base of `head` and\nthe target's head, along first parents."
          },
          "head": {
            "description": "The change's head. A revision as the caller wrote it, for the store to resolve: a ref name (`main`,\n`release/1.2`), a full 64-hex changeset id or a unique prefix of at least 12 hex digits, or a\nref's earlier value: `<ref>@{N}` the value it held N moves before its current one (`@{0}`\nis the current value), `<ref>@{at=<unix seconds>}` the value set by its newest move\nrecorded at or before that instant (the writer's clock, moves read in journal order);\noptionally followed by `~N` for the N-th first-parent ancestor.",
            "type": "string"
          },
          "idempotency_key": {
            "description": "The change's land key, as a land's: one the target holds a land of is `replayed`.",
            "type": [
              "string",
              "null"
            ]
          },
          "message": {
            "description": "The landed changeset's message, as a land's; a check does not use it.",
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "head"
        ],
        "type": "object"
      },
      "type": "array"
    },
    "max_conflict_bytes": {
      "default": 32768,
      "description": "The most bytes of hunk text each conflicting change's report carries, as a land's.",
      "format": "uint64",
      "minimum": 0,
      "type": "integer"
    },
    "target": {
      "default": "main",
      "description": "The ref the changes would land on: `main` or `release/<name>`, which must exist.",
      "type": "string"
    }
  },
  "required": [
    "changes"
  ],
  "title": "LandCheckReq",
  "type": "object"
}
```

## Annotations

It only reads the store.

| Annotation | Value | Meaning |
| --- | --- | --- |
| `destructiveHint` | `false` | True: a tool that changes the store may overwrite or delete what is there, not only add to it. |
| `idempotentHint` | `true` | True: calling it again with the same arguments changes nothing more. |
| `openWorldHint` | `false` | True: it reaches beyond a closed set of things. Every tool here stays inside the store. |
| `readOnlyHint` | `true` | True: the tool does not change its environment, the store. |

Its entry in `tools/list` carries no `_meta`.

## CLI command

[`swarmops land-check`](../commands/land-check.md) runs the same operation and prints the same envelope.

## Examples

### MCP

```json
{
  "id": 13,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "changes": [
        {
          "head": "[head]"
        }
      ]
    },
    "name": "land_check"
  }
}
```

```json
{
  "id": 13,
  "jsonrpc": "2.0",
  "result": {
    "content": [
      {
        "text": "{\"api\":1,\"meta\":{\"auth\":\"trust\",\"elapsed_ms\":\"[elapsed_ms]\",\"repo\":\"[tmp]/store\",\"resolved\":{\"[head]\":\"[head]\",\"main\":\"[theirs]\"}},\"ok\":true,\"op\":\"land_check\",\"result\":{\"items\":[{\"head\":\"[head]\",\"outcome\":\"clean\",\"paths\":[{\"change\":\"modified\",\"path\":\"src/lib.rs\"}],\"root\":\"[id5]\"}],\"onto\":\"[theirs]\"}}",
        "type": "text"
      }
    ],
    "isError": false,
    "structuredContent": {
      "api": 1,
      "meta": {
        "auth": "trust",
        "elapsed_ms": "[elapsed_ms]",
        "repo": "[tmp]/store",
        "resolved": {
          "[head]": "[head]",
          "main": "[theirs]"
        }
      },
      "ok": true,
      "op": "land_check",
      "result": {
        "items": [
          {
            "head": "[head]",
            "outcome": "clean",
            "paths": [
              {
                "change": "modified",
                "path": "src/lib.rs"
              }
            ],
            "root": "[id5]"
          }
        ],
        "onto": "[theirs]"
      }
    }
  }
}
```

The server ran as `swarmops mcp --repo [tmp]/store --as agent/worker-17`, after `initialize`. Recorded by the MCP tests. A name in square brackets, such as `[tmp]` or `[c1]`, stands for what differs from run to run: the test's temporary directory, an id, a time, the version.

## Return information

A tool result: the envelope, whose `op` is `land_check`, as `structuredContent` and again as the text of its one `content` block. `isError` is true exactly when the envelope's `ok` is false. On success the envelope's `result` is what [`swarmops land-check`](../commands/land-check.md#return-information) returns.

## Errors

A failed call is a tool result with `isError: true`; the envelope's `error.code` is one of the [error codes](../errors.md).

- [`E_INVALID_ARG`](../errors.md#e_invalid_arg): arguments that do not fit `LandCheckReq`, a field named twice among them included, or that break one of the server's own rules.
- [`E_NOT_A_REPO`](../errors.md#e_not_a_repo): the server's store is not there; the server serves on.
- [`E_INTERNAL`](../errors.md#e_internal): the operation panicked, a bug.

Then the errors of the operation, as [`swarmops land-check`](../commands/land-check.md#errors) lists them.

## See also

- [`swarmops land-check`](../commands/land-check.md)
- [MCP tools](README.md)
- [MCP integration](../../develop/mcp.md)
- [Error codes](../errors.md)
