SwarmOps
ReferenceMcp toolsfetch

Page kind: Reference

fetch#

Describes v0.11.0Last changed View as Markdown

Fetches a git remote, by its name, into the store's mirror, and its followed branch's commits into the store as changesets; main never moves. Run again with nothing new, it imports nothing.

Metadata
Since
0.2.0
Mutates
yes
Identity required
no
Envelope op
fetch
Cli command
swarmops fetch
Request type
FetchReq
Annotations
{"destructiveHint":false,"idempotentHint":true,"openWorldHint":true,"readOnlyHint":false}
Max result chars
null
CLI command
swarmops fetch

Input schema#

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

FieldTypeRequiredDefaultDescription
remotestringyesThe remote, by its name.

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": "`fetch`: bring a remote's branches and tags into the store's mirror, and its followed\nbranch's commits into the store as changesets. No ref of the store moves, so it needs no\nidentity.",
  "properties": {
    "remote": {
      "description": "The remote, by its name.",
      "type": "string"
    }
  },
  "required": [
    "remote"
  ],
  "title": "FetchReq",
  "type": "object"
}

Annotations#

It moves history between the store and a git remote, and moves no ref of the store: a push moves the remote's branch only from what the last fetch saw, to a descendant of it. Run again, it fetches or sends nothing new. It reaches the remote, beyond 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.
openWorldHinttrueTrue: 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 fetch runs the same operation and prints the same envelope.

Examples#

No recorded example yet.

Return information#

A tool result: the envelope, whose op is fetch, 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 fetch 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 FetchReq, 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 fetch lists them.

See also#

On this page