Skip to main content

MODEL TYPE DESCRIBE

swamp model type describe prints the schema of a model type — its methods, arguments, data output specifications, and version. It accepts a type identifier (e.g., command/shell, @swamp/issue-lifecycle) and renders a human-readable summary by default.

$ swamp model type describe command/shell
Type: command/shell
Version: 2026.02.09.1

Data Outputs:
  result [resource] - Shell command execution result (exit code, timing, command) (infinite)
  log [file] - Shell command output (stdout and stderr) (text/plain, infinite)

Methods:
  execute - Execute the shell command and capture stdout, stderr, and exit code
    Inputs:
      run (string) *required
      workingDir (string)
      timeout (integer)
      env (object)
      ignoreExitCode (boolean)

For the YAML definition layer that configures model instances, see Model Definitions.

--json

Produces structured JSON output. The full JSON includes complete JSON Schema definitions for every method's arguments and every data output spec's schema.

$ swamp model type describe command/shell --json
{
  "type": {
    "raw": "command/shell",
    "normalized": "command/shell"
  },
  "version": "2026.02.09.1",
  "dataOutputSpecs": [
    {
      "specName": "result",
      "kind": "resource",
      "description": "Shell command execution result (exit code, timing, command)",
      "schema": { ... },
      "lifetime": "infinite",
      "garbageCollection": 10
    },
    {
      "specName": "log",
      "kind": "file",
      "description": "Shell command output (stdout and stderr)",
      "contentType": "text/plain",
      "lifetime": "infinite",
      "garbageCollection": 10,
      "streaming": true
    }
  ],
  "methods": [
    {
      "name": "execute",
      "description": "Execute the shell command and capture stdout, stderr, and exit code",
      "arguments": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "run": {
            "type": "string",
            "minLength": 1,
            "description": "The shell command to execute"
          },
          ...
        },
        "required": ["run"],
        "additionalProperties": false
      }
    }
  ]
}

Full JSON shape

Field Type Description
type.raw string Type identifier as provided.
type.normalized string Lowercased, slash-delimited form.
version string CalVer version of the model type.
dataOutputSpecs array Full output spec objects including schema, lifetime, kind.
methods array Method entries with full JSON Schema arguments.

Each dataOutputSpecs entry includes the complete JSON Schema for resource specs, or contentType and streaming fields for file specs.

Each methods entry includes the full JSON Schema for that method's arguments, including description, type constraints, and validation rules for every property.

--compact

Produces a minimal digest suited to agent discovery. Strips full JSON Schema definitions down to property names and types, and reduces data output specs to names only.

$ swamp model type describe command/shell --compact --json
{
  "type": {
    "raw": "command/shell",
    "normalized": "command/shell"
  },
  "version": "2026.02.09.1",
  "dataOutputSpecs": [
    "result",
    "log"
  ],
  "methods": [
    {
      "name": "execute",
      "description": "Execute the shell command and capture stdout, stderr, and exit code",
      "arguments": {
        "properties": {
          "run": { "type": "string" },
          "workingDir": { "type": "string" },
          "timeout": { "type": "integer" },
          "env": { "type": "object" },
          "ignoreExitCode": { "type": "boolean" }
        },
        "required": ["run"]
      }
    }
  ]
}

Compact JSON shape

Field Type Description
type.raw string Type identifier as provided.
type.normalized string Lowercased, slash-delimited form.
version string CalVer version of the model type.
dataOutputSpecs array Spec names only (strings, not objects).
methods array Method entries with simplified arguments (names and types).

The compact form omits JSON Schema metadata ($schema, description, minLength, additionalProperties, constraints) from method arguments, and replaces full data output spec objects with their specName strings.