Schema

JSON Schema

Use this JSON Schema to validate your entity-card.json files.

Schema URL

https://raw.githubusercontent.com/a2e-protocol/a2e-protocol-spec/main/schema/entity-card.schema.json

Usage

The $schema field is optional but recommended for IDE validation:

{
  "$schema": "https://raw.githubusercontent.com/a2e-protocol/a2e-protocol-spec/main/schema/entity-card.schema.json",
  "a2e": "0.1",
  "entity": { ... },
  "mcps": [ ... ]
}

Validation with CLI

# Using the A2E CLI
npx a2e validate entity-card.json

# Or using ajv-cli
npx ajv validate -s https://raw.githubusercontent.com/a2e-protocol/a2e-protocol-spec/main/schema/entity-card.schema.json -d entity-card.json

# Using check-jsonschema
pipx run check-jsonschema --schemafile https://raw.githubusercontent.com/a2e-protocol/a2e-protocol-spec/main/schema/entity-card.schema.json entity-card.json

Full Schema

{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://raw.githubusercontent.com/a2e-protocol/a2e-protocol-spec/main/schema/entity-card.schema.json",
  "title": "A2E Protocol",
  "description": "Agent-to-Entity Protocol declaration",
  "type": "object",
  "required": ["a2e", "entity", "mcps"],
  "properties": {
    "a2e": {
      "type": "string",
      "const": "0.1",
      "description": "Protocol version"
    },
    "entity": {
      "type": "object",
      "required": ["domain", "name", "category"],
      "properties": {
        "domain": {
          "type": "string",
          "description": "Primary domain (must match the host)"
        },
        "name": {
          "type": "string",
          "description": "Human-readable entity name"
        },
        "category": {
          "type": "string",
          "enum": [
            "restaurant", "beauty", "health", "hotel",
            "transport", "retail", "entertainment", "fitness",
            "education", "real_estate", "services", "other"
          ]
        },
        "description": { "type": "string", "maxLength": 500 },
        "location": {
          "type": "object",
          "properties": {
            "address": { "type": "string" },
            "city": { "type": "string" },
            "postal_code": { "type": "string" },
            "country": { "type": "string", "pattern": "^[A-Z]{2}$" },
            "lat": { "type": "number", "minimum": -90, "maximum": 90 },
            "lng": { "type": "number", "minimum": -180, "maximum": 180 }
          }
        },
        "contact": {
          "type": "object",
          "properties": {
            "phone": { "type": "string" },
            "email": { "type": "string", "format": "email" }
          }
        }
      }
    },
    "mcps": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "object",
        "required": ["endpoint", "capabilities"],
        "properties": {
          "endpoint": { "type": "string", "format": "uri", "pattern": "^https://" },
          "capabilities": {
            "type": "array",
            "minItems": 1,
            "items": { "type": "string", "pattern": "^[a-z_]+$" }
          },
          "entity_ref": { "type": "string" },
          "auth_required": { "type": "boolean", "default": false },
          "priority": { "type": "integer", "minimum": 1 }
        }
      }
    }
  }
}

Download

Download entity-card.schema.json