{
  "$id": "https://public-agents.com/schemas/tool.schema.json",
  "title": "tool",
  "description": "A tool entry (registry/tools/<slug>/tool.json)",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "$schema": {
      "type": "string",
      "const": "https://public-agents.com/schemas/tool.schema.json"
    },
    "schemaVersion": {
      "type": "number",
      "const": 1
    },
    "slug": {
      "type": "string",
      "pattern": "^[a-z0-9](?:[a-z0-9-]{0,38}[a-z0-9])?$"
    },
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 80
    },
    "kind": {
      "type": "string",
      "enum": [
        "product",
        "open-source",
        "service",
        "model",
        "framework"
      ]
    },
    "status": {
      "type": "string",
      "enum": [
        "active",
        "deprecated",
        "retired"
      ]
    },
    "summary": {
      "type": "string",
      "minLength": 20,
      "maxLength": 600
    },
    "vendor": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1,
          "maxLength": 120
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "kind": {
          "type": "string",
          "enum": [
            "person",
            "organization"
          ]
        }
      },
      "required": [
        "name",
        "kind"
      ],
      "additionalProperties": false
    },
    "license": {
      "type": "string",
      "minLength": 1,
      "maxLength": 60
    },
    "pricing": {
      "type": "string",
      "enum": [
        "free",
        "freemium",
        "paid",
        "open-source",
        "unknown"
      ]
    },
    "agentAccess": {
      "type": "object",
      "properties": {
        "noAccountNeeded": {
          "type": "boolean"
        },
        "auth": {
          "type": "string",
          "enum": [
            "none",
            "api-key",
            "oauth",
            "session",
            "other"
          ]
        },
        "notes": {
          "type": "string",
          "minLength": 1,
          "maxLength": 300
        }
      },
      "required": [
        "noAccountNeeded",
        "auth"
      ],
      "additionalProperties": false
    },
    "surfaces": {
      "type": "object",
      "properties": {
        "homepage": {
          "type": "string",
          "format": "uri"
        },
        "docs": {
          "anyOf": [
            {
              "type": "string",
              "format": "uri"
            },
            {
              "type": "null"
            }
          ]
        },
        "llmsTxt": {
          "anyOf": [
            {
              "type": "string",
              "format": "uri"
            },
            {
              "type": "null"
            }
          ]
        },
        "skills": {
          "maxItems": 20,
          "type": "array",
          "items": {
            "type": "string",
            "format": "uri"
          }
        },
        "mcp": {
          "anyOf": [
            {
              "type": "string",
              "format": "uri"
            },
            {
              "type": "null"
            }
          ]
        },
        "api": {
          "anyOf": [
            {
              "type": "string",
              "format": "uri"
            },
            {
              "type": "null"
            }
          ]
        },
        "openapi": {
          "anyOf": [
            {
              "type": "string",
              "format": "uri"
            },
            {
              "type": "null"
            }
          ]
        },
        "source": {
          "anyOf": [
            {
              "type": "string",
              "format": "uri"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "homepage"
      ],
      "additionalProperties": false
    },
    "social": {
      "type": "object",
      "properties": {
        "x": {
          "anyOf": [
            {
              "type": "string",
              "pattern": "^[A-Za-z0-9_]{1,15}$"
            },
            {
              "type": "null"
            }
          ]
        },
        "github": {
          "anyOf": [
            {
              "type": "string",
              "pattern": "^[A-Za-z0-9](?:[A-Za-z0-9-]{0,37}[A-Za-z0-9])?$"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "additionalProperties": false
    },
    "domains": {
      "minItems": 1,
      "maxItems": 10,
      "type": "array",
      "items": {
        "type": "string",
        "pattern": "^(?=.{1,253}$)(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z]{2,63}$"
      }
    },
    "maintainers": {
      "maxItems": 10,
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "github": {
            "type": "string",
            "pattern": "^[A-Za-z0-9](?:[A-Za-z0-9-]{0,37}[A-Za-z0-9])?$"
          }
        },
        "required": [
          "github"
        ],
        "additionalProperties": false
      }
    },
    "provenance": {
      "type": "string",
      "enum": [
        "vendor",
        "third-party"
      ]
    },
    "jobs": {
      "maxItems": 60,
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "job": {
            "type": "string",
            "pattern": "^[a-z]{2,6}\\.[a-z0-9]+(?:-[a-z0-9]+)*$"
          },
          "summary": {
            "type": "string",
            "minLength": 1,
            "maxLength": 300
          },
          "source": {
            "type": "string",
            "format": "uri"
          },
          "since": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}$"
          }
        },
        "required": [
          "job",
          "summary"
        ],
        "additionalProperties": false
      }
    },
    "disclosure": {
      "type": "object",
      "properties": {
        "aiOperated": {
          "type": "boolean"
        },
        "statement": {
          "type": "string",
          "minLength": 20,
          "maxLength": 600
        }
      },
      "required": [
        "aiOperated",
        "statement"
      ],
      "additionalProperties": false
    },
    "created": {
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
    },
    "updated": {
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
    },
    "version": {
      "type": "integer",
      "minimum": 1,
      "maximum": 9007199254740991
    }
  },
  "required": [
    "schemaVersion",
    "slug",
    "name",
    "kind",
    "status",
    "summary",
    "vendor",
    "pricing",
    "surfaces",
    "domains",
    "maintainers",
    "created",
    "updated",
    "version"
  ],
  "additionalProperties": false
}
