{
  "openapi": "3.1.0",
  "info": {
    "title": "ThriveOnDev public website API",
    "version": "1.0.0",
    "description": "Read-only product information through MCP and the website's health status. These endpoints require no credentials."
  },
  "servers": [{ "url": "https://thriveondev.com" }],
  "externalDocs": {
    "description": "ThriveOnDev API documentation",
    "url": "https://thriveondev.com/docs/reference/api/"
  },
  "paths": {
    "/mcp": {
      "post": {
        "operationId": "sendMcpMessage",
        "summary": "Send a message to the ThriveOnDev MCP server",
        "description": "Use Streamable HTTP with an Accept header that includes application/json and text/event-stream. The server returns a single JSON response or acknowledges a notification with an empty response. Unsupported HTTP methods return a JSON-RPC error with HTTP 405.",
        "security": [],
        "requestBody": {
          "required": true,
          "description": "One UTF-8 JSON-RPC message, up to 1 MiB. Send initialize, ping, tools/list, tools/call, or the notifications/initialized notification.",
          "content": {
            "application/json": {
              "schema": { "$ref": "#/components/schemas/RpcRequest" },
              "examples": {
                "listTools": {
                  "value": { "jsonrpc": "2.0", "id": 1, "method": "tools/list" }
                },
                "callTool": {
                  "value": {
                    "jsonrpc": "2.0",
                    "id": 2,
                    "method": "tools/call",
                    "params": { "name": "get_product_overview" }
                  }
                }
              }
            },
            "application/ld+json": {
              "schema": { "$ref": "#/components/schemas/RpcRequest" }
            }
          }
        },
        "responses": {
          "200": {
            "description": "A JSON-RPC result or a method or parameter error",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    { "$ref": "#/components/schemas/RpcSuccess" },
                    { "$ref": "#/components/schemas/RpcError" }
                  ]
                }
              }
            }
          },
          "202": { "description": "Notification accepted. No response body." },
          "400": {
            "description": "Malformed JSON or an invalid JSON-RPC request",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/RpcError" }
              }
            }
          },
          "413": {
            "description": "The request body exceeds the 1 MiB limit",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/RpcError" }
              }
            }
          },
          "500": {
            "description": "The server could not complete the request",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/RpcError" }
              }
            }
          }
        }
      }
    },
    "/api/health": {
      "get": {
        "operationId": "getWebsiteHealth",
        "summary": "Check the website's health",
        "security": [],
        "responses": {
          "200": {
            "description": "The website is responding",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["status", "service"],
                  "properties": {
                    "status": { "const": "ok" },
                    "service": { "const": "website" }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "RpcId": { "type": ["string", "number", "null"] },
      "RpcRequest": {
        "type": "object",
        "required": ["jsonrpc", "method"],
        "properties": {
          "jsonrpc": { "const": "2.0" },
          "id": { "$ref": "#/components/schemas/RpcId" },
          "method": { "type": "string" },
          "params": {
            "type": "object",
            "properties": {
              "protocolVersion": {
                "type": "string",
                "description": "For initialize, the MCP version requested by the client."
              },
              "name": {
                "type": "string",
                "description": "For tools/call, a tool name returned by tools/list."
              }
            }
          }
        }
      },
      "RpcSuccess": {
        "type": "object",
        "required": ["jsonrpc", "id", "result"],
        "additionalProperties": false,
        "properties": {
          "jsonrpc": { "const": "2.0" },
          "id": { "$ref": "#/components/schemas/RpcId" },
          "result": {
            "type": "object",
            "description": "Initialize returns server metadata, tools/list returns available tools, tools/call returns text content, and ping returns an empty object.",
            "properties": {
              "protocolVersion": { "type": "string" },
              "capabilities": { "type": "object" },
              "serverInfo": { "type": "object" },
              "instructions": { "type": "string" },
              "tools": {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": ["name", "inputSchema"],
                  "properties": {
                    "name": { "type": "string" },
                    "title": { "type": "string" },
                    "description": { "type": "string" },
                    "inputSchema": { "type": "object" },
                    "annotations": { "type": "object" }
                  }
                }
              },
              "content": {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": ["type", "text"],
                  "properties": {
                    "type": { "const": "text" },
                    "text": { "type": "string" }
                  }
                }
              },
              "isError": { "type": "boolean" }
            }
          }
        }
      },
      "RpcError": {
        "type": "object",
        "required": ["jsonrpc", "id", "error"],
        "additionalProperties": false,
        "properties": {
          "jsonrpc": { "const": "2.0" },
          "id": { "$ref": "#/components/schemas/RpcId" },
          "error": {
            "type": "object",
            "required": ["code", "message", "data"],
            "properties": {
              "code": { "type": "integer" },
              "message": { "type": "string" },
              "data": {
                "type": "object",
                "required": ["hint"],
                "properties": { "hint": { "type": "string" } }
              }
            }
          }
        }
      }
    }
  }
}
