Skip to content
Cockpit0.29.0
A snapshot: read at commit 707a04c7ce8 on 2026-10-18T00:06:01Z by majordomus 0.29.0. Nothing on this page is read again. See it live

objects.get

Get one object

What it is

One object by URI (majordomus://<kind>/<identity>): metadata, provenance and content; a URI a query projects (majordomus://repository) answers that query as a JSON document. The same resolution serves the MCP resource read.

Descriptor

Canonical id
objects.get
Module
objects
Kind
query
Stability
behaviorallyverified
Provenance
declared
Source
apps/majordomus-cli/src/capability/builtin/objects.rs
Cache
disabled
Benchmark
required
Tags
objects

Run

query
A query. It reads and changes nothing.

`majordomus://<kind>/<identity>`, or a URI a query projects (`majordomus://repository`).

GET /api/v1/object

Projections

InterfaceAsWhere
MCP toolmajordomus_get-
MCP resourcenot exposed-
HTTPGET /api/v1/objectSwagger
Command linenot exposed-

Schemas

Input · GetInput
{
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "uri": {
      "type": "string",
      "description": "`majordomus://<kind>/<identity>`, or a URI a query projects\n(`majordomus://repository`)."
    }
  },
  "required": [
    "uri"
  ],
  "description": "The input of `objects.get`: which object.",
  "title": "GetInput"
}
Output · ResourceView
{
  "oneOf": [
    {
      "$ref": "#/$defs/ObjectView",
      "type": "object",
      "properties": {
        "source": {
          "type": "string",
          "const": "declarative"
        }
      },
      "required": [
        "source"
      ],
      "description": "A file of the layer, read as it is."
    },
    {
      "$ref": "#/$defs/AnswerView",
      "type": "object",
      "properties": {
        "source": {
          "type": "string",
          "const": "builtin"
        }
      },
      "required": [
        "source"
      ],
      "description": "A query with a resource exposure, executed and rendered as a JSON document."
    }
  ],
  "description": "The answer of `objects.get`: what the URI resolved to, tagged by `source` the way a\ncapability's provenance is.",
  "title": "ResourceView",
  "$defs": {
    "ObjectProvenance": {
      "type": "object",
      "properties": {
        "path": {
          "type": "string",
          "description": "Repository-relative path, forward slashes, as the version-control index names it."
        },
        "directory": {
          "type": "string",
          "description": "The directory the path sits in, repository-relative; `.` for the root. This is the\nhierarchy position a client orders by; no merge semantics are implied."
        },
        "source_class": {
          "type": "string",
          "description": "The `sources.yaml` class that discovered the file (`rule`, `readme`, ...)."
        },
        "section": {
          "type": [
            "string",
            "null"
          ],
          "description": "The manifest section the path falls under (`rules`, `prompts`, ...), when it falls\nunder one; a root `README.md` falls under none."
        },
        "bytes": {
          "type": "integer",
          "format": "uint64",
          "minimum": 0,
          "description": "Size of the file in bytes."
        },
        "member": {
          "type": [
            "string",
            "null"
          ],
          "description": "For an object that is one member of a collection file: the member's key path in\nthe file (`claims.3`)."
        }
      },
      "required": [
        "path",
        "directory",
        "source_class",
        "bytes"
      ],
      "description": "Where an object came from. Every field is computed from the repository, never authored."
    },
    "ObjectView": {
      "type": "object",
      "properties": {
        "uri": {
          "type": "string",
          "description": "`majordomus://<kind>/<identity>`."
        },
        "id": {
          "type": "string",
          "description": "The capability id, `<kind>.<identity>`."
        },
        "kind": {
          "type": "string",
          "description": "The kind the object was read as (`rule`, `prompt`, `document`, ...)."
        },
        "identity": {
          "type": "string",
          "description": "The identity within the kind (`majordomus.scope-integrity@1`, `continue`, a path)."
        },
        "title": {
          "type": [
            "string",
            "null"
          ],
          "description": "The title the kind's title rule found, when it found one."
        },
        "description": {
          "type": [
            "string",
            "null"
          ],
          "description": "The one-line description the kind's description field held, when it held one."
        },
        "metadata": {
          "description": "The parsed front matter or YAML, keys in the file's order."
        },
        "provenance": {
          "$ref": "#/$defs/ObjectProvenance",
          "description": "Where the object came from: path, directory, source class, section, size, member."
        },
        "media_type": {
          "type": "string",
          "description": "IANA media type of `content` (`text/markdown`, `application/yaml`, `application/json`, `text/plain`)."
        },
        "content": {
          "type": "string",
          "description": "The file as read."
        }
      },
      "required": [
        "uri",
        "id",
        "kind",
        "identity",
        "metadata",
        "provenance",
        "media_type",
        "content"
      ],
      "description": "One declarative object of the repository's layer, as a client reads it."
    },
    "CapabilityKind": {
      "oneOf": [
        {
          "type": "string",
          "const": "query",
          "description": "Executable and read-only: a typed handler, an input schema, an output schema."
        },
        {
          "type": "string",
          "const": "command",
          "description": "Executable and changing something: a typed handler, bound to `POST` over HTTP, and\nannounced to MCP clients as not read-only. Most reach no further than this process's\nown memory (a peer announcing itself); one that writes the repository's tracked\nrecords says so on its execution policy, which is where a projection reads it."
        },
        {
          "type": "string",
          "const": "resource",
          "description": "Declarative content the repository holds: read as it is, never executed."
        }
      ],
      "description": "What a capability is. Three kinds exist because three semantics exist: something that\nis executed and changes nothing, something that is executed and changes this process's\nown memory, and something that is read. A command may also write the repository's own\ntracked records, which its kind does not say and its execution policy does\n(`ExecutionPolicy::writes_repository`).\n\nHow *long* a call takes is not a kind. A read that walks every file of the layer is\nstill a read, and the thing that makes it worth watching — that it reports as it goes\nand stops when it is asked to — is one property of its handler, declared with\n`crate::capability::Executable::cancellable` and carried on `ExecutionPolicy`."
    },
    "CapabilityProvenance": {
      "oneOf": [
        {
          "type": "object",
          "properties": {
            "module": {
              "type": "string",
              "description": "The Rust module the descriptor was composed in."
            },
            "source": {
              "type": "string",
              "const": "builtin"
            }
          },
          "required": [
            "source",
            "module"
          ],
          "description": "Written in Rust, in the named module of this executable.\nWritten in Rust, composed in `builtin.rs`."
        },
        {
          "type": "object",
          "properties": {
            "path": {
              "type": "string",
              "description": "Repository-relative path."
            },
            "directory": {
              "type": "string",
              "description": "The directory the path sits in, repository-relative; `.` for the root."
            },
            "source_class": {
              "type": "string",
              "description": "The `sources.yaml` class that discovered the file."
            },
            "section": {
              "type": [
                "string",
                "null"
              ],
              "description": "The manifest section the path falls under, when it falls under one."
            },
            "media_type": {
              "type": "string",
              "description": "IANA media type of the object's content."
            },
            "member": {
              "type": [
                "string",
                "null"
              ],
              "description": "For one member of a collection file, its key path in the file (`claims.3`)."
            },
            "source": {
              "type": "string",
              "const": "declarative"
            }
          },
          "required": [
            "source",
            "path",
            "directory",
            "source_class",
            "media_type"
          ],
          "description": "Read from the repository's layer."
        }
      ],
      "description": "Where a capability came from. Never an absolute path."
    },
    "AnswerView": {
      "type": "object",
      "properties": {
        "uri": {
          "type": "string",
          "description": "The URI as given."
        },
        "id": {
          "type": "string",
          "description": "The capability that answered (`repository.info`)."
        },
        "kind": {
          "$ref": "#/$defs/CapabilityKind",
          "description": "Its kind: `query`."
        },
        "identity": {
          "type": "string",
          "description": "The resource name a client lists (`repository`)."
        },
        "title": {
          "type": "string",
          "description": "The capability's title."
        },
        "description": {
          "type": [
            "string",
            "null"
          ],
          "description": "The capability's description, when it has one."
        },
        "answer": {
          "description": "The answer, as the capability's output schema describes it (`capabilities.describe`\ncarries that schema)."
        },
        "provenance": {
          "$ref": "#/$defs/CapabilityProvenance",
          "description": "Where the capability comes from: the Rust module it is composed in."
        },
        "media_type": {
          "type": "string",
          "description": "`application/json`."
        },
        "content": {
          "type": "string",
          "description": "The answer as text: byte for byte what `resources/read` returns for the URI."
        }
      },
      "required": [
        "uri",
        "id",
        "kind",
        "identity",
        "title",
        "answer",
        "provenance",
        "media_type",
        "content"
      ],
      "description": "A URI a query projects (`majordomus://repository`), answered: the same fields a client\nreads on an `ObjectView` where they apply, the answer itself as data, and the text\n`resources/read` returns for the URI."
    }
  }
}

Examples

These are the capability's own benchmark cases: the same inputs the benchmark runs and the OpenAPI document shows.

first-object
{
  "uri": "majordomus://adr/adr-0001"
}
repository
{
  "uri": "majordomus://repository"
}