{
  "openapi": "3.1.0",
  "info": {
    "title": "Weather — NOAA Weather API",
    "version": "1.0.0",
    "description": "Free NOAA National Weather Service data for people and AI agents: current conditions, 7-day forecasts and observed daily weather history for five US agricultural regions, proxied live from api.weather.gov and cached for about 15 minutes. All endpoints are GET, return JSON, and need no API key. The same data is available as an MCP server (3 tools) at https://weather.morningbrief.link/mcp.",
    "contact": {
      "name": "Morning Brief",
      "url": "https://morningbrief.link/docs"
    }
  },
  "servers": [
    {
      "url": "https://weather.morningbrief.link"
    }
  ],
  "tags": [
    {
      "name": "Status"
    },
    {
      "name": "Weather"
    },
    {
      "name": "MCP"
    }
  ],
  "paths": {
    "/": {
      "get": {
        "tags": [
          "Status"
        ],
        "summary": "Service summary",
        "description": "Service name, version and endpoint list. (Browsers sending Accept: text/html get the HTML landing page instead.)",
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK — JSON object with the requested data.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "NOAA source unavailable — standard source_unavailable gap envelope",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/v1/status": {
      "get": {
        "tags": [
          "Status"
        ],
        "summary": "Service status & upstream health",
        "description": "Dataset catalog plus a deep health check: a live api.weather.gov reachability probe; returns 503 when NOAA is unreachable.",
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK — JSON object with the requested data.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "NOAA source unavailable — standard source_unavailable gap envelope",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/health": {
      "get": {
        "tags": [
          "Status"
        ],
        "summary": "Health check",
        "description": "Returns { ok: true, service: \"weather-api\", version }.",
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK — JSON object with the requested data.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "NOAA source unavailable — standard source_unavailable gap envelope",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/v1/weather/current": {
      "get": {
        "tags": [
          "Weather"
        ],
        "summary": "Current conditions",
        "description": "Current observed conditions for a region (live proxy of api.weather.gov).",
        "parameters": [
          {
            "name": "location",
            "in": "query",
            "required": false,
            "description": "Location key, see /v1/weather/locations.",
            "schema": {
              "type": "string",
              "default": "IL-central"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK — JSON object with the requested data.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "NOAA source unavailable — standard source_unavailable gap envelope",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/v1/weather/forecast": {
      "get": {
        "tags": [
          "Weather"
        ],
        "summary": "7-day forecast",
        "description": "NOAA forecast for a region (live proxy of api.weather.gov).",
        "parameters": [
          {
            "name": "location",
            "in": "query",
            "required": false,
            "description": "Location key, see /v1/weather/locations.",
            "schema": {
              "type": "string",
              "default": "IL-central"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Max rows to return (clamped to 1–1000).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 1000
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK — JSON object with the requested data.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "NOAA source unavailable — standard source_unavailable gap envelope",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/v1/weather/locations": {
      "get": {
        "tags": [
          "Weather"
        ],
        "summary": "Weather locations",
        "description": "Regions available for the weather endpoints.",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Max rows to return (clamped to 1–1000).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 1000
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK — JSON object with the requested data.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "NOAA source unavailable — standard source_unavailable gap envelope",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/v1/weather/history": {
      "get": {
        "tags": [
          "Weather"
        ],
        "summary": "Observed weather history",
        "description": "Recent observed weather for a region, summarized by day (high/low °F, precipitation inches).",
        "parameters": [
          {
            "name": "location",
            "in": "query",
            "required": false,
            "description": "Location key, see /v1/weather/locations.",
            "schema": {
              "type": "string",
              "default": "IL-central"
            }
          },
          {
            "name": "days",
            "in": "query",
            "required": false,
            "description": "Days of history (max 30).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 30,
              "default": 7
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Max rows to return (clamped to 1–1000).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 1000
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK — JSON object with the requested data.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "NOAA source unavailable — standard source_unavailable gap envelope",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/mcp": {
      "post": {
        "tags": [
          "MCP"
        ],
        "summary": "MCP server endpoint (streamable HTTP)",
        "description": "Model Context Protocol endpoint — 3 tools: get_weather, get_forecast, get_weather_history. Send JSON-RPC 2.0 (initialize, tools/list, tools/call). No auth.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "JSON-RPC 2.0 request."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "JSON-RPC response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string"
          }
        }
      }
    }
  }
}