{
  "openapi": "3.1.0",
  "info": {
    "title": "botcorpus API",
    "version": "0.1",
    "description": "Fresh, sourced civic/tax/financial facts for AI agents. Primary channel is the MCP endpoint (POST /mcp, JSON-RPC 2.0); these REST helpers expose the same corpus over GET. Every fact carries value, unit, valid_from, source{url,quote,retrieved} and confidence. Informational only — not legal or tax advice.",
    "contact": { "url": "https://botcorpus.com/llms.txt" }
  },
  "servers": [{ "url": "https://botcorpus.com" }],
  "paths": {
    "/mcp": {
      "get": {
        "summary": "Search facts, look up one fact, recent lookups, trust, or endpoint info",
        "parameters": [
          { "name": "q", "in": "query", "schema": { "type": "string" }, "description": "Full-text query, e.g. 'minimálna mzda 2026'" },
          { "name": "country", "in": "query", "schema": { "type": "string" }, "description": "Filter by country, e.g. SK" },
          { "name": "limit", "in": "query", "schema": { "type": "integer", "default": 8 } },
          { "name": "id", "in": "query", "schema": { "type": "string" }, "description": "Fact id, e.g. sk/tax/vat-standard — returns the full fact" },
          { "name": "recent", "in": "query", "schema": { "type": "integer" }, "description": "Return the last N search lookups (who/what/when)" },
          { "name": "trust", "in": "query", "schema": { "type": "string" }, "description": "Return corpus trust metadata (sourced %, confidence, freshness SLA)" }
        ],
        "responses": { "200": { "description": "JSON result (search results, fact, recent list, trust, or info)" } }
      },
      "post": {
        "summary": "MCP endpoint (Streamable HTTP, JSON-RPC 2.0)",
        "description": "Methods: initialize, tools/list, tools/call. Tools: lookup_fact(id), search(query,country?,limit?,agent?), list_facts(country?).",
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object" } } } },
        "responses": { "200": { "description": "JSON-RPC response" } }
      }
    },
    "/corpus/index.json": {
      "get": { "summary": "Full fact index + trust metadata", "responses": { "200": { "description": "Index of all facts" } } }
    },
    "/corpus/{country}/{domain}/{slug}.json": {
      "get": {
        "summary": "A single fact entity",
        "parameters": [
          { "name": "country", "in": "path", "required": true, "schema": { "type": "string" }, "example": "sk" },
          { "name": "domain", "in": "path", "required": true, "schema": { "type": "string" }, "example": "tax" },
          { "name": "slug", "in": "path", "required": true, "schema": { "type": "string" }, "example": "vat-standard" }
        ],
        "responses": { "200": { "description": "Fact JSON" }, "404": { "description": "Not found" } }
      }
    }
  }
}
