{
  "$schema": "https://static.modelcontextprotocol.io/schemas/mcp-server-card/v1.json",
  "version": "1.0",
  "protocolVersion": "2025-06-18",
  "serverInfo": {
    "name": "triviapi",
    "title": "TriviAPI",
    "version": "1.0.0"
  },
  "description": "Curated trivia API. Tools map to REST endpoints on the public JSON API (no separate MCP transport yet). See openapi.yaml and llms.txt.",
  "documentation": {
    "openapi": "https://triviapi.com/openapi.yaml",
    "llmsTxt": "https://triviapi.com/llms.txt",
    "apiCatalog": "https://triviapi.com/.well-known/api-catalog.json"
  },
  "authentication": {
    "required": false
  },
  "tools": [
    {
      "name": "get_questions",
      "title": "Get random quiz questions",
      "description": "GET /api/questions — random approved questions. Use mode=quiz (default) or mode=trivia for facts. Filter by category, difficulty, type, tags, language.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "amount": { "type": "integer", "minimum": 1, "maximum": 50, "default": 10 },
          "mode": { "type": "string", "enum": ["quiz", "trivia"], "default": "quiz" },
          "category": { "type": "string", "description": "Category slug or id" },
          "difficulty": { "type": "string", "enum": ["easy", "medium", "hard"] },
          "type": { "type": "string", "enum": ["multiple", "boolean"] },
          "tags": { "type": "string", "description": "Comma-separated tag slugs" },
          "match": { "type": "string", "enum": ["all", "any"], "default": "all" },
          "language": { "type": "string", "default": "en" }
        }
      },
      "x-rest": { "method": "GET", "path": "/api/questions" }
    },
    {
      "name": "get_fact_of_the_day",
      "title": "Fact of the day",
      "description": "GET /api/fact-of-the-day — deterministic fact for a UTC date. Optional category, tag, language.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "date": { "type": "string", "format": "date", "description": "YYYY-MM-DD, default today UTC" },
          "category": { "type": "string" },
          "tag": { "type": "string" },
          "language": { "type": "string", "default": "en" }
        }
      },
      "x-rest": { "method": "GET", "path": "/api/fact-of-the-day" }
    },
    {
      "name": "check_answer",
      "title": "Check an answer",
      "description": "POST /api/answer — verify a quiz answer and update calibration stats.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "questionId": { "type": "integer" },
          "answer": { "type": "string" }
        },
        "required": ["questionId", "answer"]
      },
      "x-rest": { "method": "POST", "path": "/api/answer", "body": { "questionId": "{questionId}", "answer": "{answer}" } }
    },
    {
      "name": "list_categories",
      "title": "List categories",
      "description": "GET /api/categories",
      "inputSchema": {
        "type": "object",
        "properties": {
          "language": { "type": "string", "default": "en" }
        }
      },
      "x-rest": { "method": "GET", "path": "/api/categories" }
    },
    {
      "name": "list_tags",
      "title": "Discover tags",
      "description": "GET /api/tags — themed quiz building blocks.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "search": { "type": "string" },
          "kind": { "type": "string" },
          "language": { "type": "string", "default": "en" },
          "limit": { "type": "integer", "maximum": 500, "default": 100 }
        }
      },
      "x-rest": { "method": "GET", "path": "/api/tags" }
    }
  ]
}