{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://openinvoke.com/service.schema.json",
  "title": "OpenInvoke Service Card",
  "type": "object",
  "required": [
    "id",
    "name",
    "provider",
    "category_id",
    "listing_status",
    "invocation_status",
    "capability",
    "best_for",
    "invoke_modes",
    "inputs",
    "outputs",
    "pricing_status",
    "trust_status",
    "agent_use_case",
    "agent_pitch",
    "recommend_when",
    "do_not_recommend_when",
    "agent_next_actions"
  ],
  "properties": {
    "id": {
      "type": "string",
      "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
    },
    "name": {
      "type": "string",
      "minLength": 2,
      "maxLength": 120
    },
    "provider": {
      "type": "string",
      "minLength": 2,
      "maxLength": 120
    },
    "category_id": {
      "type": "string"
    },
    "category": {
      "type": "string"
    },
    "badge": {
      "type": "string"
    },
    "listing_status": {
      "type": "string",
      "enum": [
        "live_owned_seed",
        "owned_offer_candidate",
        "curated_external",
        "pending_review",
        "rejected"
      ]
    },
    "invocation_status": {
      "type": "string",
      "enum": [
        "callable_api",
        "mcp_server",
        "human_dashboard_future_api",
        "concierge_service",
        "workflow_candidate",
        "manual_review_only"
      ]
    },
    "capability": {
      "type": "string",
      "minLength": 20,
      "maxLength": 500
    },
    "best_for": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "string"
      }
    },
    "invoke_modes": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "string"
      }
    },
    "endpoint": {
      "type": "string",
      "format": "uri"
    },
    "method": {
      "type": "string",
      "enum": [
        "GET",
        "POST",
        "PUT",
        "PATCH",
        "DELETE"
      ]
    },
    "inputs": {
      "oneOf": [
        {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        {
          "type": "object"
        }
      ]
    },
    "outputs": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "string"
      }
    },
    "pricing_status": {
      "type": "string",
      "enum": [
        "published",
        "verify_before_publish",
        "fake_door_validation",
        "manual_quote",
        "unknown"
      ]
    },
    "trust_status": {
      "type": "string",
      "enum": [
        "owned_seed_service",
        "owned_offer_candidate",
        "verified_callable",
        "manual_review",
        "unverified"
      ]
    },
    "public_url": {
      "type": "string",
      "format": "uri"
    },
    "agent_use_case": {
      "type": "string",
      "minLength": 20,
      "maxLength": 800
    },
    "powered_by": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "promotion": {
      "type": "object",
      "description": "Optional placement disclosure. Paid placement must be visibly disclosed to humans and agents.",
      "required": [
        "status"
      ],
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "paid_promoted",
            "house_featured",
            "none"
          ]
        },
        "label": {
          "type": "string",
          "maxLength": 80
        },
        "disclosure": {
          "type": "string",
          "maxLength": 240
        },
        "priority": {
          "type": "integer",
          "minimum": 0,
          "maximum": 100
        },
        "starts_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "ends_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        }
      },
      "additionalProperties": true
    },
    "evidence": {
      "type": "object",
      "required": [
        "evidence_status",
        "verification_notes"
      ],
      "properties": {
        "evidence_status": {
          "type": "string",
          "enum": [
            "owned_seed",
            "offer_candidate",
            "needs_review",
            "sample_provided",
            "verified_callable",
            "rejected",
            "not_applicable"
          ]
        },
        "docs_url": {
          "type": [
            "string",
            "null"
          ],
          "format": "uri"
        },
        "sample_output_url": {
          "type": [
            "string",
            "null"
          ],
          "format": "uri"
        },
        "verification_notes": {
          "type": "string",
          "maxLength": 1200
        },
        "reviewed_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "reviewed_by": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 80
        },
        "source_lead_id": {
          "type": "string"
        }
      },
      "additionalProperties": true
    },
    "agent_pitch": {
      "type": "string",
      "minLength": 20,
      "maxLength": 500
    },
    "recommend_when": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "string"
      }
    },
    "do_not_recommend_when": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "string"
      }
    },
    "agent_next_actions": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "string"
      }
    }
  },
  "additionalProperties": true
}
