{
  "openapi": "3.1.0",
  "info": {
    "title": "Kasper Electrical Reviews API",
    "version": "1.0.0",
    "description": "Read-only API exposing verified customer reviews and aspect-based sentiment insights for Kasper Electrical, West Palm Beach, FL."
  },
  "servers": [
    {
      "url": "https://kasperelectricalreviews.com"
    }
  ],
  "paths": {
    "/reviews.json": {
      "get": {
        "operationId": "getReviews",
        "summary": "Full reviews dataset",
        "description": "Returns business metadata, aggregate rating, and the full set of verified reviews.",
        "responses": {
          "200": {
            "description": "The reviews dataset.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Business, aggregate rating, and reviews array."
                }
              }
            }
          }
        }
      }
    },
    "/insights.json": {
      "get": {
        "operationId": "getInsights",
        "summary": "Sentiment insights dataset",
        "description": "Returns aspect-based sentiment analysis, entities (technicians, services, service areas), topics, FAQ, and an editorial summary.",
        "responses": {
          "200": {
            "description": "The insights dataset.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Aspects, entities, topics, FAQ, and summary."
                }
              }
            }
          }
        }
      }
    },
    "/api/feed.json": {
      "get": {
        "operationId": "getFeed",
        "summary": "JSON Feed of newest reviews",
        "description": "Returns the 50 newest reviews as a JSON Feed v1.1 document.",
        "responses": {
          "200": {
            "description": "A JSON Feed v1.1 document.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "JSON Feed v1.1 (version, title, items[])."
                }
              }
            }
          }
        }
      }
    },
    "/api/reviews/search": {
      "get": {
        "operationId": "searchReviews",
        "summary": "Search reviews",
        "description": "Searches reviews by rating, date range, keyword, or mentioned technician/service. HTTP equivalent of the MCP search_reviews tool.",
        "parameters": [
          {
            "name": "rating",
            "in": "query",
            "required": false,
            "description": "Exact star rating to match.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 5
            }
          },
          {
            "name": "min_rating",
            "in": "query",
            "required": false,
            "description": "Minimum star rating (inclusive).",
            "schema": {
              "type": "number",
              "minimum": 1,
              "maximum": 5
            }
          },
          {
            "name": "since",
            "in": "query",
            "required": false,
            "description": "Only reviews on or after this date (YYYY-MM-DD).",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "until",
            "in": "query",
            "required": false,
            "description": "Only reviews on or before this date (YYYY-MM-DD).",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "query",
            "in": "query",
            "required": false,
            "description": "Substring search within review text.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "mentions_technician",
            "in": "query",
            "required": false,
            "description": "Only reviews mentioning the named technician.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "mentions_service",
            "in": "query",
            "required": false,
            "description": "Only reviews mentioning the given service id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum number of reviews to return (default 20, max 100).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Matching reviews.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Matching reviews with full fields."
                }
              }
            }
          },
          "400": {
            "description": "Invalid query parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Validation error with issues array."
                }
              }
            }
          }
        }
      }
    },
    "/api/reviews/since/{date}": {
      "get": {
        "operationId": "getReviewsSince",
        "summary": "Reviews since a date",
        "description": "Returns reviews with date on or after the given ISO date. Supports conditional GET (If-None-Match / If-Modified-Since).",
        "parameters": [
          {
            "name": "date",
            "in": "path",
            "required": true,
            "description": "ISO date (YYYY-MM-DD). Returns reviews on or after this date.",
            "schema": {
              "type": "string",
              "format": "date"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Reviews on or after the date.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Reviews array filtered by date."
                }
              }
            }
          }
        }
      }
    },
    "/mcp": {
      "post": {
        "operationId": "mcp",
        "summary": "MCP streamable HTTP endpoint",
        "description": "Model Context Protocol server over streamable HTTP. Read-only tools over the review dataset.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "A JSON-RPC 2.0 MCP request."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "An MCP / JSON-RPC response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "A JSON-RPC 2.0 MCP response."
                }
              }
            }
          }
        }
      }
    }
  }
}