Skip to content

observe_deployment_scale

Observe requested replicas on one managed Swarm Deployment without mutations. Bound current-service tasks, exclude historical/old-service counts, block zero while terminating tasks remain. Deployment Read and Swarm Read+Inspect. Separate cached matching evidence, fresh desired/task state, execution and application health; bounded wait never deploys or rolls back.

Availability

Available under the default capability policy

The instance’s tool selection and upstream Core permissions also apply. Some inputs require additional grants.

Effect annotations

  • readOnlyHint — true
  • destructiveHint — false
  • idempotentHint — true

Inputs

The registered schema gives field types, alternatives and declared bounds. The description and operator guides also cover checks applied at runtime.

replicas
Required · type "integer" · minimum 0 · maximum 1000
target
Required · type "object"
timeout_seconds
type "integer" · minimum 1 · maximum 30 · default 5
Show input JSON Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "properties": {
    "replicas": {
      "format": "int32",
      "maximum": 1000,
      "minimum": 0,
      "type": "integer"
    },
    "target": {
      "additionalProperties": false,
      "oneOf": [
        {
          "required": [
            "id"
          ]
        },
        {
          "required": [
            "name"
          ]
        }
      ],
      "properties": {
        "id": {
          "pattern": "^[0-9a-fA-F]{24}$",
          "type": "string"
        },
        "name": {
          "maxLength": 128,
          "minLength": 1,
          "type": "string"
        }
      },
      "type": "object"
    },
    "timeout_seconds": {
      "default": 5,
      "format": "uint64",
      "maximum": 30,
      "minimum": 1,
      "type": "integer"
    }
  },
  "required": [
    "target",
    "replicas"
  ],
  "type": "object"
}

Output

The registered output schema covers structured results and tool errors.

ScaleObservation
end, evidence_limit, latest, mutations_submitted, observation_error, requested_replicas, samples, saved_replicas, swarm_id, target
AppError
candidates, correction, field, kind, message, operation, status
Show output JSON Schema
{
  "type": "object",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "anyOf": [
    {
      "$ref": "#/$defs/ScaleObservation"
    },
    {
      "$ref": "#/$defs/AppError"
    }
  ],
  "$defs": {
    "AppError": {
      "additionalProperties": false,
      "description": "Only application-owned messages and selected, nonsensitive metadata survive.",
      "properties": {
        "candidates": {
          "items": {
            "$ref": "#/$defs/Candidate"
          },
          "type": [
            "array",
            "null"
          ]
        },
        "correction": {
          "type": [
            "string",
            "null"
          ]
        },
        "field": {
          "type": [
            "string",
            "null"
          ]
        },
        "kind": {
          "$ref": "#/$defs/ErrorKind"
        },
        "message": {
          "type": "string"
        },
        "operation": {
          "type": "string"
        },
        "status": {
          "format": "uint16",
          "maximum": 65535,
          "minimum": 0,
          "type": [
            "integer",
            "null"
          ]
        }
      },
      "required": [
        "kind",
        "message",
        "operation"
      ],
      "type": "object"
    },
    "Candidate": {
      "additionalProperties": false,
      "description": "A bounded ambiguity hint, never a raw upstream resource.",
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        }
      },
      "required": [
        "id",
        "name"
      ],
      "type": "object"
    },
    "ConfigurationTarget": {
      "properties": {
        "id": {
          "type": [
            "string",
            "null"
          ]
        },
        "kind": {
          "type": "string"
        },
        "name": {
          "type": "string"
        }
      },
      "required": [
        "kind",
        "id",
        "name"
      ],
      "type": "object"
    },
    "ErrorKind": {
      "description": "Stable public categories. No variant contains a raw upstream error.",
      "enum": [
        "invalid_arguments",
        "not_found",
        "ambiguous_target",
        "incomplete_resolution",
        "configuration",
        "authentication",
        "permission_denied",
        "timeout",
        "unreachable",
        "upstream",
        "invalid_response",
        "response_too_large",
        "capability_disabled",
        "unsupported_target",
        "stale_preview",
        "invalid_preview"
      ],
      "type": "string"
    },
    "ReplicaSample": {
      "properties": {
        "application_health": {
          "type": "string"
        },
        "cached_service": {
          "$ref": "#/$defs/Service"
        },
        "core_task_health": {
          "type": "string"
        },
        "current_running": {
          "format": "uint",
          "minimum": 0,
          "type": "integer"
        },
        "failed_current": {
          "format": "uint",
          "minimum": 0,
          "type": "integer"
        },
        "fresh_task_coverage_incomplete": {
          "type": "boolean"
        },
        "fresh_tasks": {
          "items": {
            "$ref": "#/$defs/Task"
          },
          "type": "array"
        },
        "gaps": {
          "items": {
            "$ref": "#/$defs/AppError"
          },
          "type": "array"
        },
        "historical_tasks": {
          "format": "uint",
          "minimum": 0,
          "type": "integer"
        },
        "matching_replica_observations": {
          "type": "boolean"
        },
        "other_service_tasks_ignored": {
          "format": "uint",
          "minimum": 0,
          "type": "integer"
        },
        "pending_current": {
          "format": "uint",
          "minimum": 0,
          "type": "integer"
        },
        "scan_incomplete": {
          "type": "boolean"
        },
        "service": {
          "$ref": "#/$defs/Service"
        },
        "terminating_running": {
          "format": "uint",
          "minimum": 0,
          "type": "integer"
        },
        "unknown_tasks": {
          "format": "uint",
          "minimum": 0,
          "type": "integer"
        }
      },
      "required": [
        "service",
        "cached_service",
        "current_running",
        "pending_current",
        "failed_current",
        "unknown_tasks",
        "historical_tasks",
        "terminating_running",
        "other_service_tasks_ignored",
        "fresh_tasks",
        "scan_incomplete",
        "fresh_task_coverage_incomplete",
        "matching_replica_observations",
        "core_task_health",
        "application_health",
        "gaps"
      ],
      "type": "object"
    },
    "ScaleObservation": {
      "properties": {
        "end": {
          "type": "string"
        },
        "evidence_limit": {
          "type": "string"
        },
        "latest": {
          "anyOf": [
            {
              "$ref": "#/$defs/ReplicaSample"
            },
            {
              "type": "null"
            }
          ]
        },
        "mutations_submitted": {
          "format": "uint8",
          "maximum": 255,
          "minimum": 0,
          "type": "integer"
        },
        "observation_error": {
          "anyOf": [
            {
              "$ref": "#/$defs/AppError"
            },
            {
              "type": "null"
            }
          ]
        },
        "requested_replicas": {
          "format": "int32",
          "type": "integer"
        },
        "samples": {
          "format": "uint8",
          "maximum": 255,
          "minimum": 0,
          "type": "integer"
        },
        "saved_replicas": {
          "format": "int32",
          "type": [
            "integer",
            "null"
          ]
        },
        "swarm_id": {
          "type": [
            "string",
            "null"
          ]
        },
        "target": {
          "anyOf": [
            {
              "$ref": "#/$defs/ConfigurationTarget"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "target",
        "swarm_id",
        "requested_replicas",
        "saved_replicas",
        "samples",
        "end",
        "latest",
        "observation_error",
        "mutations_submitted",
        "evidence_limit"
      ],
      "type": "object"
    },
    "Service": {
      "properties": {
        "desired_replicas": {
          "format": "uint64",
          "minimum": 0,
          "type": [
            "integer",
            "null"
          ]
        },
        "id": {
          "type": "string"
        },
        "mode": {
          "type": [
            "string",
            "null"
          ]
        },
        "name": {
          "type": [
            "string",
            "null"
          ]
        },
        "running_tasks": {
          "description": "Docker often supplies this only on the cached list, not fresh inspect.",
          "format": "uint64",
          "minimum": 0,
          "type": [
            "integer",
            "null"
          ]
        },
        "state": {
          "type": "string"
        },
        "update_state": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "id",
        "name",
        "mode",
        "desired_replicas",
        "running_tasks",
        "state",
        "update_state"
      ],
      "type": "object"
    },
    "Task": {
      "properties": {
        "desired_state": {
          "type": [
            "string",
            "null"
          ]
        },
        "exit_code": {
          "format": "int64",
          "type": [
            "integer",
            "null"
          ]
        },
        "failure_reason": {
          "description": "Conservative application-owned classification; never raw Docker errors.",
          "type": [
            "string",
            "null"
          ]
        },
        "id": {
          "type": "string"
        },
        "name": {
          "type": [
            "string",
            "null"
          ]
        },
        "node_id": {
          "type": [
            "string",
            "null"
          ]
        },
        "replica_evidence": {
          "description": "current = desired running; historical = desired shutdown/remove;\nunknown = Core did not establish either. Not a healthy-replica count.",
          "type": "string"
        },
        "service_id": {
          "type": [
            "string",
            "null"
          ]
        },
        "slot": {
          "format": "int64",
          "type": [
            "integer",
            "null"
          ]
        },
        "state": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "id",
        "name",
        "service_id",
        "node_id",
        "state",
        "desired_state",
        "replica_evidence",
        "slot",
        "exit_code",
        "failure_reason"
      ],
      "type": "object"
    }
  }
}

Operator guides

All built-in tools