{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://agenarys.com/schemas/agent-native-saas.schema.json",
  "title": "Agenarys Agent-Native SaaS Tool Listing",
  "type": "object",
  "required": [
    "id",
    "name",
    "provider",
    "category",
    "summary",
    "homepage_url",
    "mcp_server_url",
    "agent_auth_type",
    "capability_manifest",
    "agenarys_validation_lane",
    "programmable_payment",
    "verification"
  ],
  "properties": {
    "id": {
      "type": "string",
      "pattern": "^[a-z0-9][a-z0-9-]{2,80}$"
    },
    "name": {
      "type": "string",
      "minLength": 2
    },
    "provider": {
      "type": "object",
      "required": ["legal_name", "support_contact", "country"],
      "properties": {
        "legal_name": { "type": "string" },
        "support_contact": { "type": "string" },
        "country": { "type": "string" }
      },
      "additionalProperties": false
    },
    "category": {
      "type": "string",
      "examples": ["Accounting", "CRM", "Scheduling", "Dispatch", "Payments"]
    },
    "summary": {
      "type": "string"
    },
    "homepage_url": {
      "type": "string",
      "format": "uri"
    },
    "mcp_server_url": {
      "type": "string",
      "format": "uri"
    },
    "agent_capabilities_url": {
      "type": "string",
      "format": "uri"
    },
    "agent_auth_type": {
      "type": "string",
      "enum": ["OAuth2", "APIKey", "Token", "WalletSession", "MCP-Delegated-OAuth"]
    },
    "capability_manifest": {
      "type": "array",
      "items": {
        "type": "string",
        "pattern": "^[a-z][a-z0-9_]{2,80}$"
      },
      "minItems": 1,
      "uniqueItems": true,
      "examples": [["execute_invoice", "read_crm_data"]]
    },
    "agenarys_validation_lane": {
      "type": "string",
      "enum": [
        "lead_generation",
        "lead_follow_up",
        "sales_conversion",
        "customer_experience",
        "reviews_reputation",
        "service_quality",
        "operations_fulfillment",
        "staff_performance",
        "scheduling_capacity",
        "financial_health",
        "offer_pricing",
        "content_authority",
        "local_visibility",
        "partnerships_referrals",
        "systems_automation",
        "compliance_risk"
      ]
    },
    "programmable_payment": {
      "type": "object",
      "required": [
        "payment_protocol",
        "settlement_currency",
        "spending_guard_required",
        "platform_fee_percent",
        "autonomous_approval_required"
      ],
      "properties": {
        "payment_protocol": {
          "type": "string",
          "examples": ["Stripe-Agent-API", "Nevermined-Wallet-Link", "Skyfire-Wallet", "USDC-Escrow"]
        },
        "settlement_currency": {
          "type": "string",
          "examples": ["USD", "USDC"]
        },
        "spending_guard_required": {
          "type": "boolean"
        },
        "platform_fee_percent": {
          "type": "number",
          "minimum": 0,
          "maximum": 25
        },
        "autonomous_approval_required": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    },
    "quality_validation": {
      "type": "object",
      "required": ["gate_name", "engine", "required_for_certification"],
      "properties": {
        "gate_name": {
          "type": "string",
          "const": "Agenarys CodeProof"
        },
        "engine": {
          "type": "string",
          "enum": ["fallow", "not_applicable"]
        },
        "required_for_certification": {
          "type": "boolean"
        },
        "minimum_engine_verdict": {
          "type": "string",
          "enum": ["pass"]
        },
        "self_correction_required_on": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": ["warn", "fail"]
          },
          "uniqueItems": true
        }
      },
      "additionalProperties": false
    },
    "verification": {
      "type": "object",
      "required": ["status", "last_checked_at", "trust_score", "checks"],
      "properties": {
        "status": {
          "type": "string",
          "enum": ["pending", "verified", "limited", "rejected"]
        },
        "last_checked_at": {
          "type": "string",
          "format": "date-time"
        },
        "trust_score": {
          "type": "integer",
          "minimum": 0,
          "maximum": 100
        },
        "payment_ready": {
          "type": "boolean"
        },
        "required_gates": {
          "type": "array",
          "items": { "type": "string" }
        },
        "checks": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "additionalProperties": false
    }
  },
  "additionalProperties": false
}
