SwarmOps
ReferenceMcp toolsqueue_withdraw

Page kind: Reference

queue_withdraw#

Describes v0.13.0Last changed View as Markdown

Takes an open entry out of its landing queue (reason withdrawn); it is never published. One that landed is E_INVALID_ARG (already_landed).

Metadata
Since
0.13.0
Mutates
yes
Identity required
yes
Envelope op
queue_withdraw
Cli command
swarmops queue withdraw
Request type
QueueWithdrawReq
Annotations
{"destructiveHint":true,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":false}
Max result chars
null

Input schema#

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

FieldTypeRequiredDefaultDescription
entrystringyesThe entry's id.

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": "`queue_withdraw`: take an open entry out of its queue (reason `withdrawn`). One that landed\nis `E_INVALID_ARG` (`details.reason` `already_landed`), and nothing is written. The answer\nis the entry.",
  "properties": {
    "entry": {
      "description": "The entry's id.",
      "type": "string"
    }
  },
  "required": [
    "entry"
  ],
  "title": "QueueWithdrawReq",
  "type": "object"
}

Annotations#

It moves or deletes refs by compare-and-swap, changing what they name. Run again with the same arguments, it finds them as it asked (already_applied) or not as it expected (E_CAS_MISMATCH), and changes nothing more.

AnnotationValueMeaning
destructiveHinttrueTrue: 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.
readOnlyHintfalseTrue: the tool does not change its environment, the store.

Its entry in tools/list carries no _meta.

CLI command#

swarmops queue withdraw runs the same operation and prints the same envelope.

Examples#

JSON
{
  "id": 4,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "entry": "[entry2]"
    },
    "name": "queue_withdraw"
  }
}
JSON
{
  "id": 4,
  "jsonrpc": "2.0",
  "result": {
    "content": [
      {
        "text": "{\"api\":1,\"meta\":{\"auth\":\"trust\",\"elapsed_ms\":\"[elapsed_ms]\",\"repo\":\"[tmp]/store\",\"resolved\":{}},\"ok\":true,\"op\":\"queue_withdraw\",\"result\":{\"base\":\"[main]\",\"head\":\"[second]\",\"id\":\"[entry2]\",\"removal\":\"withdrawn\",\"state\":\"removed\",\"target\":\"main\"}}",
        "type": "text"
      }
    ],
    "isError": false,
    "structuredContent": {
      "api": 1,
      "meta": {
        "auth": "trust",
        "elapsed_ms": "[elapsed_ms]",
        "repo": "[tmp]/store",
        "resolved": {}
      },
      "ok": true,
      "op": "queue_withdraw",
      "result": {
        "base": "[main]",
        "head": "[second]",
        "id": "[entry2]",
        "removal": "withdrawn",
        "state": "removed",
        "target": "main"
      }
    }
  }
}

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 queue_withdraw, 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 queue withdraw 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 QueueWithdrawReq, a field named twice among them included, or that break one of the server's own rules.
  • E_IDENTITY_REQUIRED: the server runs with no identity.
  • 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 queue withdraw lists them.

See also#

On this page