{
  "openapi": "3.1.0",
  "info": {
    "title": "Precise Calculator Discovery API",
    "version": "1.0.0",
    "description": "Public read-only calculator discovery. Calculations run in the browser, not through an HTTP calculation endpoint."
  },
  "servers": [
    {
      "url": "https://precisecalculator.com"
    }
  ],
  "security": [],
  "paths": {
    "/api/v1/calculators.json": {
      "get": {
        "operationId": "listCalculators",
        "summary": "List the published calculator catalog",
        "responses": {
          "200": {
            "description": "JSON document",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "count",
                    "calculators",
                    "authentication",
                    "calculationTransport"
                  ],
                  "properties": {
                    "count": {
                      "type": "integer",
                      "minimum": 1
                    },
                    "version": {
                      "type": "string"
                    },
                    "updated": {
                      "type": "string",
                      "format": "date"
                    },
                    "authentication": {
                      "const": "none"
                    },
                    "calculationTransport": {
                      "const": "browser-webmcp"
                    },
                    "calculators": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Calculator"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/status.json": {
      "get": {
        "operationId": "getCatalogStatus",
        "summary": "Get catalog publication status; gateway checks catalog availability",
        "responses": {
          "200": {
            "description": "JSON document",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "503": {
            "description": "Catalog unavailable when the gateway is installed"
          }
        },
        "description": "With the gateway, performs a fresh read and JSON validation of the published catalog. It does not test every calculator engine, browser or external service. The static fallback only reports publication metadata."
      }
    }
  },
  "components": {
    "schemas": {
      "Calculator": {
        "type": "object",
        "required": [
          "id",
          "name",
          "category",
          "description",
          "url",
          "browserTool"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "category": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "browserTool": {
            "type": "string"
          },
          "keywords": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      }
    }
  }
}
