{
  "openapi": "3.1.0",
  "info": {
    "title": "Anvilstead machine-readable business endpoints",
    "version": "1.0.0",
    "summary": "Structured facts about Anvilstead for software clients and AI systems.",
    "description": "Three static JSON documents describing this business, plus a Model Context Protocol server. They exist so a software client can read structured facts instead of scraping HTML. The documents are generated at build time and are read-only; there is no authentication and no rate limit beyond what Cloudflare applies to the site as a whole.",
    "contact": {
      "name": "Anvilstead",
      "email": "hello@anvilstead.com",
      "url": "https://anvilstead.com/contact"
    },
    "license": {
      "name": "Read and quote freely; do not present as your own",
      "identifier": "NOASSERTION"
    }
  },
  "servers": [
    {
      "url": "https://anvilstead.com",
      "description": "Production"
    }
  ],
  "tags": [
    {
      "name": "Business facts",
      "description": "Structured descriptions of the company, its services and how it engages clients."
    },
    {
      "name": "Agent interface",
      "description": "A callable Model Context Protocol endpoint, for clients that would rather ask than parse."
    }
  ],
  "paths": {
    "/ai/summary.json": {
      "get": {
        "tags": ["Business facts"],
        "operationId": "getSummary",
        "summary": "Company, service, engagement and pricing facts",
        "description": "The single document to read first. Contains the legal entity, the five service lines, the engagement model, the pricing structure, and a caseNotes array linking the four engineering case notes. Every figure in it comes from the running business rather than from an estimate.",
        "responses": {
          "200": {
            "description": "The summary document",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/Summary" }
              }
            }
          }
        }
      }
    },
    "/ai/faq.json": {
      "get": {
        "tags": ["Business facts"],
        "operationId": "getFaq",
        "summary": "Questions clients ask before engaging, with answers",
        "description": "Short answers to the questions that arrive before a project starts: what things cost, how long they take, who owns the code, whether an NDA can be signed, how work is kept on track.",
        "responses": {
          "200": {
            "description": "The FAQ document",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/Faq" }
              }
            }
          }
        }
      }
    },
    "/ai/service.json": {
      "get": {
        "tags": ["Business facts"],
        "operationId": "getServices",
        "summary": "Service catalogue with deliverables and timelines",
        "description": "Each service line with what it includes, what the client receives, and typical timelines. Also carries the caseNotes pointer to the worked examples.",
        "responses": {
          "200": {
            "description": "The service catalogue",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/ServiceCatalogue" }
              }
            }
          }
        }
      }
    },
    "/api/mcp": {
      "post": {
        "tags": ["Agent interface"],
        "operationId": "mcpJsonRpc",
        "summary": "Model Context Protocol endpoint (JSON-RPC 2.0)",
        "description": "A callable interface for MCP-compatible clients. Implements `initialize`, `tools/list` and `tools/call`. The tools reproduce the facts in the three JSON documents above, so a client that calls a tool gets the same answer as one that reads the file — the difference is that it can ask instead of parse. The server card at /.well-known/mcp/server-card.json declares the same capabilities for discovery.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": { "$ref": "#/components/schemas/JsonRpcRequest" },
              "examples": {
                "listTools": {
                  "summary": "Ask which tools exist",
                  "value": { "jsonrpc": "2.0", "id": 1, "method": "tools/list" }
                },
                "callTool": {
                  "summary": "Ask for the service catalogue",
                  "value": {
                    "jsonrpc": "2.0",
                    "id": 2,
                    "method": "tools/call",
                    "params": { "name": "list_services", "arguments": {} }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "A JSON-RPC 2.0 response, or a JSON-RPC error object",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/JsonRpcResponse" }
              }
            }
          },
          "405": {
            "description": "Method not allowed. Only POST is accepted; use GET on the card for discovery."
          }
        }
      },
      "get": {
        "tags": ["Agent interface"],
        "operationId": "mcpDescribe",
        "summary": "Describe the MCP server over plain HTTP",
        "description": "Returns the same capability description as the server card. Provided because a browser, a curl command or a monitoring check cannot speak JSON-RPC, and 'what is this endpoint' should be answerable without one.",
        "responses": {
          "200": {
            "description": "Server description",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/McpServerCard" }
              }
            }
          }
        }
      }
    },
    "/.well-known/mcp/server-card.json": {
      "get": {
        "tags": ["Agent interface"],
        "operationId": "getMcpServerCard",
        "summary": "Model Context Protocol server card",
        "description": "The discovery document. Lists the server name, the protocol revision, the transport, and the tool names with their descriptions, so a client knows what it can call before calling anything.",
        "responses": {
          "200": {
            "description": "The server card",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/McpServerCard" }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Summary": {
        "type": "object",
        "description": "Company and service facts.",
        "properties": {
          "brand": { "type": "string" },
          "legalEntity": { "type": "string" },
          "services": {
            "type": "array",
            "items": { "$ref": "#/components/schemas/Service" }
          },
          "engagement": { "type": "object" },
          "pricing": { "type": "object" },
          "workingHours": { "type": "object" },
          "caseNotes": {
            "type": "array",
            "items": { "$ref": "#/components/schemas/CaseNote" }
          },
          "lastUpdated": { "type": "string", "format": "date" }
        }
      },
      "Service": {
        "type": "object",
        "properties": {
          "id": { "type": "string" },
          "name": { "type": "string" },
          "summary": { "type": "string" }
        }
      },
      "CaseNote": {
        "type": "object",
        "description": "A worked example. Engineering notes state what was built, what was rejected and what the choice cost.",
        "properties": {
          "name": { "type": "string" },
          "url": { "type": "string", "format": "uri" },
          "summary": { "type": "string" }
        }
      },
      "Faq": {
        "type": "object",
        "properties": {
          "brand": { "type": "string" },
          "website": { "type": "string", "format": "uri" },
          "faq": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "q": { "type": "string" },
                "a": { "type": "string" }
              },
              "required": ["q", "a"]
            }
          },
          "lastUpdated": { "type": "string", "format": "date" }
        }
      },
      "ServiceCatalogue": {
        "type": "object",
        "properties": {
          "brand": { "type": "string" },
          "services": { "type": "array", "items": { "$ref": "#/components/schemas/Service" } },
          "caseNotes": { "type": "object" },
          "lastUpdated": { "type": "string", "format": "date" }
        }
      },
      "JsonRpcRequest": {
        "type": "object",
        "required": ["jsonrpc", "method"],
        "properties": {
          "jsonrpc": { "type": "string", "const": "2.0" },
          "id": { "oneOf": [{ "type": "string" }, { "type": "number" }, { "type": "null" }] },
          "method": {
            "type": "string",
            "enum": ["initialize", "tools/list", "tools/call", "ping"]
          },
          "params": { "type": "object" }
        }
      },
      "JsonRpcResponse": {
        "type": "object",
        "properties": {
          "jsonrpc": { "type": "string", "const": "2.0" },
          "id": { "oneOf": [{ "type": "string" }, { "type": "number" }, { "type": "null" }] },
          "result": { "type": "object" },
          "error": {
            "type": "object",
            "properties": {
              "code": { "type": "integer" },
              "message": { "type": "string" }
            }
          }
        }
      },
      "McpServerCard": {
        "type": "object",
        "properties": {
          "name": { "type": "string" },
          "version": { "type": "string" },
          "description": { "type": "string" },
          "protocolVersion": { "type": "string" },
          "transport": { "type": "object" },
          "capabilities": { "type": "object" },
          "tools": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": { "type": "string" },
                "description": { "type": "string" }
              }
            }
          }
        }
      }
    }
  }
}
