{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/agentik-cc/json-schema/agentik-cc-discover-response-schema.json",
  "title": "DiscoverResponse",
  "x-generated": "2026-11-05",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/agentik-cc-openapi.yml#/components/schemas/DiscoverResponse",
  "type": "object",
  "properties": {
    "query": {
      "type": "string"
    },
    "results": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "tool_id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "price": {
            "$ref": "#/$defs/Pricing"
          },
          "price_estimate_usd": {
            "type": "number",
            "description": "Typical cost of one call, comparable across pricing models"
          },
          "status": {
            "type": "string",
            "enum": [
              "active"
            ],
            "description": "Discovery only returns tools available now"
          },
          "available": {
            "type": "boolean",
            "const": true
          },
          "score": {
            "type": "number"
          },
          "reliability_7d": {
            "type": "number",
            "description": "Share of successful runs over the last 7 days, when runs exist"
          },
          "p50_ms": {
            "type": "integer",
            "description": "Median latency over the last 7 days, when runs exist"
          },
          "runs_7d": {
            "type": "integer"
          },
          "why": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Why this result ranks where it does"
          }
        },
        "additionalProperties": true
      }
    }
  },
  "$defs": {
    "Pricing": {
      "oneOf": [
        {
          "type": "object",
          "required": [
            "model",
            "amountUsd"
          ],
          "properties": {
            "model": {
              "const": "per_call"
            },
            "amountUsd": {
              "type": "number"
            },
            "multipliers": {
              "type": "array",
              "items": {
                "type": "object"
              }
            }
          }
        },
        {
          "type": "object",
          "required": [
            "model",
            "amountUsd",
            "unitsPath",
            "maxUnits"
          ],
          "properties": {
            "model": {
              "const": "per_unit"
            },
            "amountUsd": {
              "type": "number"
            },
            "unitsPath": {
              "type": "string"
            },
            "maxUnits": {
              "type": "number"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "model",
            "amountUsd",
            "maxMinutes"
          ],
          "properties": {
            "model": {
              "const": "per_minute"
            },
            "amountUsd": {
              "type": "number"
            },
            "maxMinutes": {
              "type": "number"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "model",
            "costPath",
            "maxUsdDefault",
            "maxUsdCap"
          ],
          "properties": {
            "model": {
              "const": "reported"
            },
            "costPath": {
              "type": "string"
            },
            "costMode": {
              "const": "actual",
              "description": "Reservation is an estimate; bill the exact receipt without a per-call cap."
            },
            "reservationBasis": {
              "type": "string"
            },
            "maxUsdDefault": {
              "type": "number"
            },
            "maxUsdCap": {
              "type": "number"
            }
          }
        }
      ]
    }
  }
}