SwarmOps
ReferenceMcp toolsblob_has
View as Markdown

blob_has#

Of the blob ids given, the ones the store holds blobs under: the contents a commit can name by id without storing them again.

Metadata
Since
0.1.0
Mutates
no
Identity required
no
Envelope op
blob_has
Cli command
swarmops blob has
Request type
BlobHasReq
Annotations
{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":true}
Max result chars
null

Input schema#

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

FieldTypeRequiredDefaultDescription
idsarray of stringyesThe blob ids, 64 hex digits each; one that is not is E_INVALID_ARG.

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": "`blob_has` (CLI `blob has`): which of some blobs the store holds.",
  "properties": {
    "ids": {
      "description": "The blob ids, 64 hex digits each; one that is not is `E_INVALID_ARG`.",
      "items": {
        "type": "string"
      },
      "type": "array"
    }
  },
  "required": [
    "ids"
  ],
  "title": "BlobHasReq",
  "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 blob has runs the same operation and prints the same envelope.

Examples#

{
  "id": 4,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "ids": [
        "[blob]"
      ]
    },
    "name": "blob_has"
  }
}
{
  "id": 4,
  "jsonrpc": "2.0",
  "result": {
    "content": [
      {
        "text": "{\"ok\":true,\"op\":\"blob_has\",\"api\":1,\"result\":{\"present\":[\"[blob]\"]},\"meta\":{\"repo\":\"[tmp]/store\",\"elapsed_ms\":\"[elapsed_ms]\",\"resolved\":{},\"auth\":\"trust\"}}",
        "type": "text"
      }
    ],
    "isError": false,
    "structuredContent": {
      "api": 1,
      "meta": {
        "auth": "trust",
        "elapsed_ms": "[elapsed_ms]",
        "repo": "[tmp]/store",
        "resolved": {}
      },
      "ok": true,
      "op": "blob_has",
      "result": {
        "present": [
          "[blob]"
        ]
      }
    }
  }
}

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#

Of the blob ids given, it returns those the store holds a blob under: content a commit can name by id without storing it again. Each id is 64 hex digits; a shorter one is E_INVALID_ARG.

Return information#

A tool result: the envelope, whose op is blob_has, 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 blob has 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 BlobHasReq, 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 blob has lists them.

See also#

Edit on GitHub

On this page