get_dataset_details
Retrieve comprehensive information about specific Hong Kong government datasets, including metadata, resources, and optional tracking details for data analysis and research purposes.
Instructions
Get detailed information about a specific dataset
Args: dataset_id: The ID or name of the dataset to retrieve language: Language code (en, tc, sc) include_tracking: Add tracking information to dataset and resources
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dataset_id | Yes | ||
| include_tracking | No | ||
| language | No | en |
Implementation Reference
- src/mcp_open_data_hk/server.py:60-85 (handler)The handler function for the 'get_dataset_details' tool. It is decorated with @mcp.tool for registration and fetches detailed dataset information from the data.gov.hk API using the package_show endpoint, supporting language selection and optional tracking summary.@mcp.tool async def get_dataset_details( dataset_id: str, language: str = "en", include_tracking: bool = False ) -> Dict[str, Any]: """ Get detailed information about a specific dataset Args: dataset_id: The ID or name of the dataset to retrieve language: Language code (en, tc, sc) include_tracking: Add tracking information to dataset and resources """ base_url = BASE_URLS.get(language, BASE_URLS["en"]) url = f"{base_url}/package_show" params = {"id": dataset_id} if include_tracking: params["include_tracking"] = "true" result = await make_api_request(url, params) if result.get("success"): return result["result"] else: raise Exception(f"API Error: {result.get('error', 'Unknown error')}")