{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/advisorppc-com/json-schema/advisorppc-com-agent-card-out-schema.json",
  "title": "AgentCardOut",
  "description": "One agent card = the global definition merged with this tenant's\ninstance state (enabled?, last run, pending-question count).",
  "x-generated": "2026-10-31",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/advisorppc-com-openapi.json#/components/schemas/AgentCardOut",
  "properties": {
    "key": {
      "type": "string",
      "title": "Key"
    },
    "name": {
      "type": "string",
      "title": "Name"
    },
    "platform": {
      "type": "string",
      "title": "Platform"
    },
    "description": {
      "type": "string",
      "title": "Description"
    },
    "placement_lock": {
      "additionalProperties": true,
      "type": "object",
      "title": "Placement Lock"
    },
    "read_tools": {
      "items": {
        "type": "string"
      },
      "type": "array",
      "title": "Read Tools"
    },
    "write_tools": {
      "items": {
        "type": "string"
      },
      "type": "array",
      "title": "Write Tools"
    },
    "writes_enabled": {
      "type": "boolean",
      "title": "Writes Enabled"
    },
    "version": {
      "type": "integer",
      "title": "Version"
    },
    "enabled": {
      "type": "boolean",
      "title": "Enabled"
    },
    "instance": {
      "anyOf": [
        {
          "$ref": "#/$defs/AgentInstanceOut"
        },
        {
          "type": "null"
        }
      ]
    },
    "last_run": {
      "anyOf": [
        {
          "$ref": "#/$defs/RunSummaryOut"
        },
        {
          "type": "null"
        }
      ]
    },
    "pending_questions": {
      "type": "integer",
      "title": "Pending Questions"
    },
    "is_custom": {
      "type": "boolean",
      "title": "Is Custom",
      "default": false
    },
    "status": {
      "type": "string",
      "title": "Status",
      "default": "active"
    },
    "how_it_works": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "How It Works"
    },
    "recommended_for": {
      "items": {
        "type": "string"
      },
      "type": "array",
      "title": "Recommended For"
    }
  },
  "type": "object",
  "required": [
    "key",
    "name",
    "platform",
    "description",
    "placement_lock",
    "read_tools",
    "write_tools",
    "writes_enabled",
    "version",
    "enabled",
    "instance",
    "last_run",
    "pending_questions"
  ],
  "$defs": {
    "AgentInstanceOut": {
      "properties": {
        "id": {
          "type": "integer",
          "title": "Id"
        },
        "display_name": {
          "type": "string",
          "title": "Display Name"
        },
        "status": {
          "type": "string",
          "title": "Status"
        },
        "health": {
          "type": "string",
          "title": "Health",
          "default": "healthy"
        },
        "last_health_detail": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Last Health Detail"
        },
        "accounts": {
          "additionalProperties": {
            "type": "string"
          },
          "type": "object",
          "title": "Accounts"
        },
        "anomaly_hold": {
          "type": "boolean",
          "title": "Anomaly Hold",
          "default": false
        },
        "automation": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "title": "Automation"
        },
        "next_run_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ],
          "title": "Next Run At"
        },
        "stopped": {
          "type": "boolean",
          "title": "Stopped",
          "default": false
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "title": "Created At"
        }
      },
      "type": "object",
      "required": [
        "id",
        "display_name",
        "status",
        "created_at"
      ],
      "title": "AgentInstanceOut",
      "description": "This tenant's enabled instance of a definition (present only once the\ntenant has hit /enable)."
    },
    "RunSummaryOut": {
      "properties": {
        "id": {
          "type": "integer",
          "title": "Id"
        },
        "status": {
          "type": "string",
          "title": "Status"
        },
        "summary": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Summary"
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "title": "Created At"
        }
      },
      "type": "object",
      "required": [
        "id",
        "status",
        "summary",
        "created_at"
      ],
      "title": "RunSummaryOut",
      "description": "Compact last-run line shown on an agent card (full detail lives in\nRunOut on the task tab)."
    }
  }
}