SwarmOps
ReferenceMcp toolscheck_list

Page kind: Reference

check_list#

Describes v0.13.0Last changed View as Markdown

Lists the checks the tree of rev, main by default, describes in .swarmops/checks.toml (version 1), or else check.argv of .swarmops/workspaces.json as the one check default: each with its argv, its directory, its timeout, the JUnit and SARIF reports it declares and the digest of its definition, sorted by name, with the tree they were read from. Reads only. A tree with neither file lists none; a file that does not read is E_CHECK_FILE with its line and key. Nothing runs a check.

Metadata
Since
0.1.0
Mutates
no
Identity required
no
Envelope op
check_list
Cli command
swarmops check list
Request type
CheckListReq
Annotations
{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":true}
Max result chars
null

Input schema#

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

FieldTypeRequiredDefaultDescription
revstringno"main"The changeset whose tree's checks to list; main when omitted. A revision as the caller wrote it, for the store to resolve: a ref name (main, release/1.2), a full 64-hex changeset id or a unique prefix of at least 12 hex digits, or a ref's earlier value: <ref>@{N} the value it held N moves before its current one (@{0} is the current value), <ref>@{at=<unix seconds>} the value set by its newest move recorded at or before that instant (the writer's clock, moves read in journal order); optionally followed by ~N for the N-th first-parent ancestor.
stagestring or nullnoOnly the checks of this stage; every check when omitted.

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": "`check_list` (CLI `check list`): the checks the tree of `rev` describes. Reads only: no lock,\nno identity, nothing written.",
  "properties": {
    "rev": {
      "default": "main",
      "description": "The changeset whose tree's checks to list; `main` when omitted. 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"
    },
    "stage": {
      "anyOf": [
        {
          "description": "When a check's answer is wanted. A check names one or more; `check run` runs one stage's\nchecks.",
          "oneOf": [
            {
              "const": "before-land",
              "description": "Before a change lands: the gate. The default.",
              "type": "string"
            },
            {
              "const": "after-land",
              "description": "After a change has landed.",
              "type": "string"
            },
            {
              "const": "scheduled",
              "description": "On a schedule.",
              "type": "string"
            },
            {
              "const": "release",
              "description": "Before a release is cut.",
              "type": "string"
            },
            {
              "const": "manual",
              "description": "Only when someone asks for it.",
              "type": "string"
            },
            {
              "const": "deploy",
              "description": "Before a deployment.",
              "type": "string"
            }
          ]
        },
        {
          "type": "null"
        }
      ],
      "description": "Only the checks of this stage; every check when omitted."
    }
  },
  "title": "CheckListReq",
  "type": "object"
}

Annotations#

It only reads the store.

AnnotationValueMeaning
destructiveHintfalseTrue: a tool that changes the store may overwrite or delete what is there, not only add to it.
idempotentHinttrueTrue: calling it again with the same arguments changes nothing more.
openWorldHintfalseTrue: it reaches beyond a closed set of things. Every tool here stays inside the store.
readOnlyHinttrueTrue: the tool does not change its environment, the store.

Its entry in tools/list carries no _meta.

CLI command#

swarmops check list runs the same operation and prints the same envelope.

Examples#

JSON
{
  "id": 48,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "check_list"
  }
}
JSON
{
  "id": 48,
  "jsonrpc": "2.0",
  "result": {
    "content": [
      {
        "text": "{\"api\":1,\"meta\":{\"auth\":\"trust\",\"elapsed_ms\":\"[elapsed_ms]\",\"repo\":\"[tmp]/store\",\"resolved\":{\"[grouped]\":\"[grouped]\",\"main\":\"[grouped]\"}},\"ok\":true,\"op\":\"check_list\",\"result\":{\"checks\":[],\"tree\":\"[id20]\",\"vouched\":false}}",
        "type": "text"
      }
    ],
    "isError": false,
    "structuredContent": {
      "api": 1,
      "meta": {
        "auth": "trust",
        "elapsed_ms": "[elapsed_ms]",
        "repo": "[tmp]/store",
        "resolved": {
          "[grouped]": "[grouped]",
          "main": "[grouped]"
        }
      },
      "ok": true,
      "op": "check_list",
      "result": {
        "checks": [],
        "tree": "[id20]",
        "vouched": false
      }
    }
  }
}

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.

Details#

It reads the tree of rev (default main) from the store the server was started on: there is no directory form here, which swarmops check list --dir serves on the command line. An answer from the store says vouched: false and names the tree it read; with stage, it lists only the checks of that stage and echoes it. Each check's declared JUnit and SARIF reports come in its reports. Nothing runs the checks it lists.

Return information#

A tool result: the envelope, whose op is check_list, 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 check list returns.

Errors#

A failed call is a tool result with isError: true; the envelope's error.code is one of the error codes.

  • E_INVALID_ARG: arguments that do not fit CheckListReq, a field named twice among them included, or that break one of the server's own rules.
  • E_NOT_A_REPO: the server's store is not there; the server serves on.
  • E_INTERNAL: the operation panicked, a bug.

Then the errors of the operation, as swarmops check list lists them.

See also#

On this page