{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "name": "Surf Spot Analyzer",
  "description": "Canary Islands surf discovery with OpenStreetMap-attributed spot data and ocean-condition forecasts.",
  "version": "2.0.0",
  "url": "https://surfspotanalyzer.es",
  "protocol": "agentic-web-v1",
  "capabilities": {
    "deep_linking": true,
    "beach_search": true,
    "beach_navigation": true,
    "surf_forecasts": true,
    "browser_bridge": "window.__SURF_AGENT__",
    "machine_readable_context": "/llms.txt",
    "full_context": "/llms-full.txt",
    "api_base": "/api"
  },
  "endpoints": {
    "list_spots": {
      "method": "GET",
      "path": "/api/spots",
      "description": "Returns full active backend spot and forecast profile records."
    },
    "spot_directory": {
      "method": "GET",
      "path": "/api/spots/directory",
      "description": "Returns compact active spot summaries for discovery, search, and navigation."
    },
    "beach_directory": {
      "method": "GET",
      "path": "/beach-directory.json",
      "description": "Bathing-beach directory with island paths, locality, practical details and available source/licensing attribution."
    },
    "surf_spot_directory": {
      "method": "GET",
      "path": "/surf-spot-directory.json",
      "description": "Named OSM features tagged sport=surfing, with island paths, coordinates, source links and ODbL attribution."
    },
    "island_current_forecasts": {
      "method": "GET",
      "path": "/api/spots/current-forecasts?island_slug={island_slug}",
      "description": "Returns each active surf spot's nearest available forecast hour for an island in one response."
    },
    "spot_detail": {
      "method": "GET",
      "path": "/api/spots/{id}",
      "description": "Returns spot profile, break type, and orientation for spot ID"
    },
    "spot_forecast": {
      "method": "GET",
      "path": "/api/spots/{id}/forecast",
      "description": "Returns current hour forecast, best window today, and trend for a spot"
    },
    "best_windows": {
      "method": "GET",
      "path": "/api/spots/{id}/forecast/best-windows",
      "parameters": {
        "days": "integer (1-7)"
      },
      "description": "Returns optimal surf time windows (score >= 65) matching daylight hours"
    },
    "hourly_forecast": {
      "method": "GET",
      "path": "/api/spots/{id}/forecast/hourly",
      "parameters": { "days": "integer (1-7)" },
      "description": "Returns hourly swell, wind, tide and surf score values"
    },
    "weekly_forecast": {
      "method": "GET",
      "path": "/api/spots/{id}/forecast/weekly",
      "description": "Returns daily surf summaries and best windows for the next seven days"
    },
    "forecast_evolution": {
      "method": "GET",
      "path": "/api/backtest/evolution/{id}",
      "description": "Returns forecast snapshots comparing latest predictions with 24-48h previous runs"
    },
    "system_status": {
      "method": "GET",
      "path": "/api/system/status",
      "description": "System health, database status and background task status"
    },
    "submit_spot_suggestion": {
      "method": "POST",
      "path": "/api/spot-suggestions",
      "description": "Submits a spot for human review. It is not published automatically."
    }
  },
  "navigation_actions": [
    {
      "action": "navigate",
      "selector": "[data-agent-action='navigate']",
      "targets": ["dashboard", "beaches", "spots-manager", "sessions", "admin", "aviso-legal", "privacidad", "cookies", "terminos", "atribuciones"]
    },
    {
      "action": "navigate_to_beach",
      "method": "window.__SURF_AGENT__.navigateToBeach(islandSlug, beachSlug?)",
      "description": "Opens an island or a specific beach at /playas/{island}/{beach}. Valid island and beach slugs can be read from getBeachDirectory()."
    },
    {
      "action": "search_beaches",
      "method": "window.__SURF_AGENT__.searchBeaches(query?, islandSlug?)",
      "description": "Searches bathing beaches by beach name, municipality, or island; matching ignores accents and case."
    },
    {
      "action": "navigate_to_beach_tool",
      "method": "modelContext.executeTool('navigate_to_beach', { island_slug, beach_slug })",
      "description": "Validates a bathing-beach path against the public directory and opens its specific landing page."
    },
    {
      "action": "select_spot",
      "selector": "[data-agent-action='select-spot'][data-agent-spot-id]",
      "parameter": "data-agent-spot-id",
      "description": "Click a SpotCard to navigate to its detail page"
    },
    {
      "action": "search_surf_spots",
      "method": "window.__SURF_AGENT__.searchSurfSpots(query?, islandSlug?)",
      "description": "Searches active surf forecast spots by name, locality, or island."
    },
    {
      "action": "navigate_to_surf_spot",
      "method": "window.__SURF_AGENT__.navigateToSurfSpot(islandSlug, spotSlug)",
      "description": "Validates an active surf spot and opens its forecast page at /surf/{island}/{spot}. Use searchSurfSpots() to find valid slugs."
    },
    {
      "action": "get_active_spot_forecast",
      "method": "window.__SURF_AGENT__.getSpotForecast(spotId?)",
      "description": "Returns the current forecast overview for the selected spot or the supplied spot ID."
    },
    {
      "action": "get_active_spot_details",
      "method": "window.__SURF_AGENT__.getSpotDetails(spotId?)",
      "description": "Returns the profile and coordinates of the selected surf spot."
    },
    {
      "action": "navigate_back",
      "selector": "[data-agent-action='navigate'][data-agent-target='dashboard']",
      "description": "Back button in SpotDetail to return to Dashboard"
    },
    {
      "action": "refresh_forecast",
      "selector": "[data-agent-action='refresh-forecast'][data-agent-spot-id]",
      "parameter": "data-agent-spot-id",
      "description": "Refreshes the forecast for the selected spot"
    },
    {
      "action": "select_nearby_surf_spot",
      "selector": "[data-agent-action='select-nearby-surf-spot'][data-agent-spot-id]",
      "parameter": "data-agent-spot-id",
      "description": "Opens a nearby surf spot from the current spot detail page"
    }
  ],
  "directory_license": "ODbL 1.0",
  "directory_attribution": "© OpenStreetMap contributors"
}
