{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://getzero.dev/contracts/zero.mcp.public_tool_results.v1.schema.json",
  "title": "ZERO public MCP tool results",
  "description": "Contract for /oss/mcp read-only tool result payloads that do not already use public operator schemas.",
  "oneOf": [
    {
      "type": "object",
      "additionalProperties": false,
      "required": ["schema_version", "strategies", "count", "mode"],
      "properties": {
        "schema_version": { "const": "zero.mcp.strategies.v1" },
        "strategies": {
          "type": "array",
          "minItems": 1,
          "items": {
            "type": "object",
            "additionalProperties": false,
            "required": ["name", "risk", "mode", "description"],
            "properties": {
              "name": { "type": "string", "minLength": 1 },
              "risk": { "enum": ["none", "low", "medium", "high"] },
              "mode": { "enum": ["paper", "paper-first"] },
              "description": { "type": "string", "minLength": 10 }
            }
          }
        },
        "count": { "type": "integer", "minimum": 1 },
        "mode": { "const": "paper-first" }
      }
    },
    {
      "type": "object",
      "additionalProperties": false,
      "required": ["schema_version", "invariants", "commercial_boundary"],
      "properties": {
        "schema_version": { "const": "zero.mcp.safety_catalog.v1" },
        "invariants": {
          "type": "array",
          "minItems": 5,
          "items": { "type": "string", "minLength": 10 }
        },
        "commercial_boundary": {
          "type": "string",
          "pattern": "ZERO Intelligence API"
        }
      }
    },
    {
      "type": "object",
      "additionalProperties": false,
      "required": ["schema_version", "repository", "docs", "proof_status"],
      "properties": {
        "schema_version": { "const": "zero.mcp.public_proof.v1" },
        "repository": { "type": "string", "format": "uri" },
        "docs": {
          "type": "object",
          "additionalProperties": false,
          "required": ["llms", "oss_mcp"],
          "properties": {
            "llms": { "type": "string", "format": "uri" },
            "oss_mcp": { "type": "string", "format": "uri" }
          }
        },
        "proof_status": { "type": "string", "minLength": 10 }
      }
    },
    {
      "type": "object",
      "required": ["schema_version", "entries", "stats", "week", "source"],
      "properties": {
        "schema_version": { "const": "zero.mcp.arena.v1" },
        "entries": { "type": "array" },
        "stats": { "type": "object" },
        "week": { "type": "object" },
        "source": { "enum": ["public_operator", "live", "seeded", "error"] }
      }
    },
    {
      "type": "object",
      "required": ["schema_version", "source", "public_operators", "season", "leaderboard", "operator"],
      "properties": {
        "schema_version": { "const": "zero.mcp.season.v1" },
        "source": { "enum": ["public_operator", "leaderboard"] },
        "public_operators": { "type": "integer", "minimum": 0 },
        "season": { "type": "object" },
        "leaderboard": { "type": "array" },
        "operator": { "type": "object" }
      }
    },
    {
      "type": "object",
      "required": ["schema_version", "name", "version", "transport", "boundary", "safety", "tools"],
      "properties": {
        "schema_version": { "const": "zero.mcp.status.v1" },
        "name": { "const": "zero-oss" },
        "version": { "type": "string", "minLength": 1 },
        "transport": { "const": "streamable-http" },
        "boundary": { "const": "public-read-only" },
        "safety": {
          "type": "object",
          "required": ["orders", "runtime_mutation", "secrets", "live_account_state"],
          "properties": {
            "orders": { "const": false },
            "runtime_mutation": { "const": false },
            "secrets": { "const": false },
            "live_account_state": { "const": false }
          }
        },
        "tools": { "type": "integer", "minimum": 8 }
      }
    }
  ]
}
