{
  "descriptorVersion": "1.0.0",
  "name": "find_beach_water_quality_sources",
  "title": "Beach and water quality sources",
  "description": "Source discovery for Hong Kong gazetted beaches, beach water quality grading and forecasts: returns the official Hong Kong government data sources (API, feed, file, PDF list or official service), their format, update notes, how to use them, limits and the matching Agoodeal page. Does not fetch or return live records, and is not a booking, diagnosis or eligibility service. No government data is fetched when it is called. Calculation or source matching runs in this page; arguments and results are not uploaded to Agoodeal servers or to Google Analytics, and the result is returned only to the calling agent. Non-sensitive usage metadata (tool name, outcome, execution mode, error code, duration; predefined source IDs for source matching) is reported through the site’s existing Google Analytics 4.",
  "execution": {
    "environment": "browser",
    "interface": "WebMCP imperative API: document.modelContext.registerTool (experimental)",
    "executionMode": "source_discovery",
    "pageUrls": [
      "https://www.agoodeal.com/tools/beach-selector/"
    ],
    "requirement": "Open one of pageUrls in a browser that exposes document.modelContext. As of October 2026 this is experimental: Chrome 149+ with chrome://flags/#enable-webmcp-testing, or an origin trial that Agoodeal has not joined. Without it the page works normally for people and no tool is registered.",
    "serverEndpoint": null,
    "argumentsEncoding": "JSON object (some browser versions require callers to pass it as a JSON string).",
    "returns": "A JSON string matching outputSchema."
  },
  "annotations": {
    "readOnlyHint": true,
    "untrustedContentHint": false,
    "consequentialHint": false
  },
  "annotationNotes": "readOnlyHint is true: the tool only returns stored official source information and does not change the page.",
  "inputSchema": {
    "type": "object",
    "additionalProperties": false,
    "properties": {
      "topic": {
        "type": "string",
        "enum": [
          "all",
          "beach_list",
          "water_quality"
        ],
        "description": "Which official source to return. Omit for all. beach_list: Gazetted beaches; water_quality: Water quality grading and forecast."
      }
    }
  },
  "outputSchema": {
    "oneOf": [
      {
        "type": "object",
        "required": [
          "ok",
          "tool",
          "mode",
          "liveDataFetched",
          "topic",
          "sources",
          "agoodealPage",
          "limits",
          "notice"
        ],
        "properties": {
          "ok": {
            "const": true
          },
          "tool": {
            "type": "string"
          },
          "mode": {
            "const": "source_discovery"
          },
          "liveDataFetched": {
            "const": false
          },
          "topic": {
            "type": "string"
          },
          "pageScope": {
            "type": [
              "string",
              "null"
            ]
          },
          "notice": {
            "type": "string"
          },
          "sources": {
            "type": "array",
            "maxItems": 5,
            "items": {
              "type": "object",
              "required": [
                "id",
                "name",
                "publisher",
                "kind",
                "url",
                "agoodealUse",
                "updateFrequency"
              ],
              "properties": {
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "publisher": {
                  "type": "string"
                },
                "kind": {
                  "type": "string"
                },
                "url": {
                  "type": "string"
                },
                "datasetUrl": {
                  "type": "string"
                },
                "documentationUrl": {
                  "type": "string"
                },
                "agoodealUse": {
                  "type": "string"
                },
                "updateFrequency": {
                  "type": "string"
                }
              }
            }
          },
          "agoodealPage": {
            "type": "string"
          },
          "coverage": {
            "type": "string"
          },
          "limits": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "howToUse": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "versionedContract": {
            "type": [
              "object",
              "null"
            ]
          }
        }
      },
      {
        "type": "object",
        "required": [
          "ok",
          "error"
        ],
        "properties": {
          "ok": {
            "const": false
          },
          "error": {
            "type": "object",
            "required": [
              "code",
              "message"
            ],
            "properties": {
              "code": {
                "enum": [
                  "invalid_json",
                  "invalid_argument",
                  "unknown_argument",
                  "internal_error"
                ]
              },
              "message": {
                "type": "string"
              },
              "field": {
                "type": "string"
              }
            }
          }
        }
      }
    ]
  },
  "privacy": "Returns stored source records only; no government data is fetched per call and nothing from the page is read. Calculation or source matching runs in this page; arguments and results are not uploaded to Agoodeal servers or to Google Analytics, and the result is returned only to the calling agent. Non-sensitive usage metadata (tool name, outcome, execution mode, error code, duration; predefined source IDs for source matching) is reported through the site’s existing Google Analytics 4.",
  "coverage": "LCSD beach list, EPD water quality grading (RSS) and daily water quality forecast.",
  "limits": [
    "Water quality grades reflect sampling periods; follow on-site flags and lifeguards."
  ],
  "officialSources": [
    {
      "id": "lcsd-beaches",
      "name": "泳灘",
      "publisher": "Leisure and Cultural Services Department",
      "kind": "json_api",
      "url": "https://www.lcsd.gov.hk/datagovhk/facility/facility-beaches.json"
    },
    {
      "id": "epd-beach-grading",
      "name": "泳灘水質等級",
      "publisher": "Environmental Protection Department",
      "kind": "rss_feed",
      "url": "https://cd.epic.epd.gov.hk/beachpsi/tc/beach2.rss"
    },
    {
      "id": "epd-beach-forecast",
      "name": "泳灘水質預報",
      "publisher": "Environmental Protection Department",
      "kind": "web_page",
      "url": "https://www.epd.gov.hk/epd/tc_chi/environmentinhk/water/beach_quality/forecast_system.html"
    }
  ],
  "agoodealPage": "https://www.agoodeal.com/tools/beach-selector/"
}
