Skip to main content
Glama
mcp-open-data-hk

Hong Kong Open Data MCP Server

Official

get_supported_formats

Discover which file formats are available for downloading datasets from Hong Kong's official open data portal, helping you identify compatible data formats before accessing government data resources.

Instructions

Get a list of file formats supported by data.gov.hk

Returns: A list of supported file formats

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The core handler function for the 'get_supported_formats' tool. It makes an API request to retrieve the list of supported file formats from data.gov.hk and returns them as a list of strings.
    async def get_supported_formats() -> List[str]: """ Get a list of file formats supported by data.gov.hk Returns: A list of supported file formats """ result = await make_api_request(FILE_FORMATS_URL) return result.get("formats", [])
  • The @mcp.tool decorator registers the get_supported_formats function as an MCP tool.
    @mcp.tool
  • Helper function used by get_supported_formats to make HTTP requests to the data.gov.hk API.
    async def make_api_request( url: str, params: Optional[Dict[str, Any]] = None ) -> Dict[str, Any]: """Make an API request to data.gov.hk""" async with httpx.AsyncClient() as client: # Print the request for debugging print(f"Making request to {url} with params {params}") response = await client.get(url, params=params) print(f"Response status: {response.status_code}") response.raise_for_status() return response.json()

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/mcp-open-data-hk/mcp-open-data-hk'

If you have feedback or need assistance with the MCP directory API, please join our Discord server