{
  "descriptorVersion": "1.0.0",
  "name": "find_ae_waiting_time_sources",
  "title": "A&E waiting time sources",
  "description": "Source discovery for Hospital Authority accident and emergency waiting times: 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. In an emergency call 999; waiting times are not medical advice. 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/ae-waiting-time/"
    ],
    "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",
          "waiting_time"
        ],
        "description": "Which official source to return. Omit for all. waiting_time: A&E waiting times."
      }
    }
  },
  "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": "Hospital Authority public hospital A&E waiting time figures by triage category.",
  "limits": [
    "Not a diagnosis, triage or quality ranking; patients are seen by clinical priority.",
    "In an emergency call 999."
  ],
  "officialSources": [
    {
      "id": "ha-ae-waiting-time",
      "name": "急症室等候時間",
      "publisher": "Hospital Authority",
      "kind": "json_api",
      "url": "https://www.ha.org.hk/opendata/aed/aedwtdata2-tc.json"
    }
  ],
  "agoodealPage": "https://www.agoodeal.com/tools/ae-waiting-time/"
}
