Page kind: Reference
queue_withdraw#
Takes an open entry out of its landing queue (reason withdrawn); it is never published. One that landed is E_INVALID_ARG (already_landed).
- 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- CLI command
swarmops queue withdraw
Input schema#
arguments is a QueueWithdrawReq: swarmops schema QueueWithdrawReq prints the type. A field the type does not know is ignored.
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
entry | string | yes | The entry's id. |
JSON Schema#
As tools/list gives it: each $ref replaced by its definition, so that it stands alone.
{
"$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.
| Annotation | Value | Meaning |
|---|---|---|
destructiveHint | true | 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 | false | True: 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#
{
"id": 4,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"entry": "[entry2]"
},
"name": "queue_withdraw"
}
}{
"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#
queue_wait
Waits for an entry to land and answers it; a removed entry is its removal's error (details.reason), and one still open after timeout\_s is…
read_file
Reads one file at a revision, without a checkout, as UTF-8 text or base64, from offset or the lines a range names; pass max\_bytes of 32768 or less (less for…