get_category_details
Retrieve comprehensive details about Hong Kong open data categories including datasets, users, groups, tags, and followers to explore government data resources.
Instructions
Get detailed information about a specific category (group)
Args: category_id: The ID or name of the category to retrieve include_datasets: Include a truncated list of the category's datasets include_dataset_count: Include the full package count include_extras: Include the category's extra fields include_users: Include the category's users include_groups: Include the category's sub groups include_tags: Include the category's tags include_followers: Include the category's number of followers language: Language code (en, tc, sc)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| category_id | Yes | ||
| include_dataset_count | No | ||
| include_datasets | No | ||
| include_extras | No | ||
| include_followers | No | ||
| include_groups | No | ||
| include_tags | No | ||
| include_users | No | ||
| language | No | en |
Implementation Reference
- src/mcp_open_data_hk/server.py:128-173 (handler)The handler function for the 'get_category_details' tool. It is decorated with @mcp.tool, which registers it with the MCP server. The function makes an API request to data.gov.hk's group_show endpoint to retrieve detailed category information based on the provided parameters.@mcp.tool async def get_category_details( category_id: str, include_datasets: bool = False, include_dataset_count: bool = True, include_extras: bool = True, include_users: bool = True, include_groups: bool = True, include_tags: bool = True, include_followers: bool = True, language: str = "en", ) -> Dict[str, Any]: """ Get detailed information about a specific category (group) Args: category_id: The ID or name of the category to retrieve include_datasets: Include a truncated list of the category's datasets include_dataset_count: Include the full package count include_extras: Include the category's extra fields include_users: Include the category's users include_groups: Include the category's sub groups include_tags: Include the category's tags include_followers: Include the category's number of followers language: Language code (en, tc, sc) """ base_url = BASE_URLS.get(language, BASE_URLS["en"]) url = f"{base_url}/group_show" params = { "id": category_id, "include_datasets": str(include_datasets).lower(), "include_dataset_count": str(include_dataset_count).lower(), "include_extras": str(include_extras).lower(), "include_users": str(include_users).lower(), "include_groups": str(include_groups).lower(), "include_tags": str(include_tags).lower(), "include_followers": str(include_followers).lower(), } 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')}")