{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/prowl-chat/json-schema/prowl-chat-tool-health-response-schema.json",
  "title": "ToolHealthResponse",
  "description": "Platform health per tool. A tool absent from `tools` had no calls in the window.",
  "x-generated": "2026-11-22",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/prowl-chat-openapi.json#/components/schemas/ToolHealthResponse",
  "properties": {
    "window_minutes": {
      "type": "integer",
      "title": "Window Minutes"
    },
    "tools": {
      "additionalProperties": {
        "$ref": "#/$defs/ToolHealth"
      },
      "type": "object",
      "title": "Tools",
      "description": "Keyed by tool name. Absent means idle, which the UI reads as healthy."
    }
  },
  "type": "object",
  "required": [
    "window_minutes",
    "tools"
  ],
  "$defs": {
    "ToolHealth": {
      "properties": {
        "total": {
          "type": "integer",
          "title": "Total",
          "description": "Calls inside the window, across all users."
        },
        "success": {
          "type": "integer",
          "title": "Success",
          "description": "How many of them succeeded."
        },
        "success_rate": {
          "type": "number",
          "title": "Success Rate",
          "description": "Percentage, 0-100."
        },
        "last_status": {
          "type": "string",
          "title": "Last Status",
          "description": "Outcome of the most recent call: `ok` or `error`."
        },
        "last_at": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Last At",
          "description": "ISO-8601 time of that call."
        }
      },
      "type": "object",
      "required": [
        "total",
        "success",
        "success_rate",
        "last_status"
      ],
      "title": "ToolHealth",
      "description": "Aggregate outcome for one tool. No per-user data, by construction."
    }
  }
}