Hong Kong Open Data MCP Server
OfficialProvides CI/CD workflows for automated testing, code quality checks, and publishing to PyPI with trusted publishing setup
Enables automated package publishing to both PyPI and TestPyPI repositories using trusted publishing for secure deployment
Supports unit testing framework for validating MCP server functionality
Built as a Python package that can be installed and run as an MCP server module
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Hong Kong Open Data MCP Serversearch for datasets about public transportation in Hong Kong"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
mcp-open-data-hk
This is an MCP (Model Context Protocol) server that provides access to data from DATA.GOV.HK, the official open data portal of the Hong Kong government.
Installation
Installing via Smithery
To install mcp-open-data-hk for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install @mcp-open-data-hk/mcp-open-data-hk --client claudeUsing uv (recommended)
When using uv no specific installation is needed. We will
use uvx to directly run mcp-server-fetch.
Using PIP
Alternatively you can install mcp-server-fetch via pip:
pip install mcp-open-data-hkAfter installation, you can run it as a script using:
python -m mcp_open_data_hkAfter installation, configure your MCP-compatible client (like Cursor, Claude Code, or Claude Desktop) by adding the following to your settings.json:
{
"mcpServers": {
"mcp-open-data-hk": {
"command": "uvx",
"args": ["mcp-open-data-hk"]
}
}
}{
"mcpServers": {
"mcp-open-data-hk": {
"command": "python",
"args": ["-m", "mcp_open_data_hk"]
}
}
}Related MCP server: Hong Kong community and social welfare MCP Server
Features
The server provides the following tools to interact with the DATA.GOV.HK API:
list_datasets- Get a list of dataset IDsget_dataset_details- Get detailed information about a specific datasetlist_categories- Get a list of data categoriesget_category_details- Get detailed information about a specific categorysearch_datasets- Search for datasets by query term with advanced optionssearch_datasets_with_facets- Search datasets and return faceted resultsget_datasets_by_format- Get datasets by file formatget_supported_formats- Get list of supported file formats
Tools
list_datasets
Get a list of dataset IDs from DATA.GOV.HK
Parameters:
limit(optional): Maximum number of datasets to return (default: 1000)offset(optional): Offset of the first dataset to returnlanguage(optional): Language code (en, tc, sc) - defaults to "en"
get_dataset_details
Get detailed information about a specific dataset
Parameters:
dataset_id: The ID or name of the dataset to retrievelanguage(optional): Language code (en, tc, sc) - defaults to "en"include_tracking(optional): Add tracking information to dataset and resources - defaults to False
list_categories
Get a list of data categories (groups)
Parameters:
order_by(optional): Field to sort by ('name' or 'packages') - deprecated, use sort insteadsort(optional): Sorting of results ('name asc', 'package_count desc', etc.) - defaults to "title asc"limit(optional): Maximum number of categories to returnoffset(optional): Offset for paginationall_fields(optional): Return full group dictionaries instead of just names - defaults to Falselanguage(optional): Language code (en, tc, sc) - defaults to "en"
get_category_details
Get detailed information about a specific category (group)
Parameters:
category_id: The ID or name of the category to retrieveinclude_datasets(optional): Include a truncated list of the category's datasets - defaults to Falseinclude_dataset_count(optional): Include the full package count - defaults to Trueinclude_extras(optional): Include the category's extra fields - defaults to Trueinclude_users(optional): Include the category's users - defaults to Trueinclude_groups(optional): Include the category's sub groups - defaults to Trueinclude_tags(optional): Include the category's tags - defaults to Trueinclude_followers(optional): Include the category's number of followers - defaults to Truelanguage(optional): Language code (en, tc, sc) - defaults to "en"
search_datasets
Search for datasets by query term using the package_search API.
This function searches across dataset titles, descriptions, and other metadata to find datasets matching the query term. It supports advanced Solr search parameters.
Parameters:
query(optional): The solr query string (e.g., "transport", "weather", ":" for all) - defaults to ":"limit(optional): Maximum number of datasets to return (default: 10, max: 1000)offset(optional): Offset for pagination - defaults to 0language(optional): Language code (en, tc, sc) - defaults to "en"
Returns: A dictionary containing:
count: Total number of matching datasetsresults: List of matching datasets (up to limit)search_facets: Faceted information about the resultshas_more: Boolean indicating if there are more results available
search_datasets_with_facets
Search for datasets and return faceted results for better data exploration.
This function is useful for exploring what types of data are available by showing counts of datasets grouped by tags, organizations, or other facets.
Parameters:
query(optional): The solr query string - defaults to ":"language(optional): Language code (en, tc, sc) - defaults to "en"
Returns: A dictionary containing:
count: Total number of matching datasetssearch_facets: Faceted information about the resultssample_results: First 3 matching datasets
get_datasets_by_format
Get datasets that have resources in a specific file format.
Parameters:
file_format: The file format to filter by (e.g., "CSV", "JSON", "GeoJSON")limit(optional): Maximum number of datasets to return - defaults to 10language(optional): Language code (en, tc, sc) - defaults to "en"
Returns: A dictionary containing:
count: Total number of matching datasetsresults: List of matching datasets
get_supported_formats
Get a list of file formats supported by DATA.GOV.HK
Returns: A list of supported file formats
Local Testing
Run test scripts:
python tests/test_client.py
python tests/debug_search.py
python tests/comprehensive_test.pyRun server directly:
python -m src.mcp_open_data_hkRun unit tests:
pytest tests/Understanding Path Configuration
When installed as a package, the server can be referenced by its module name rather than file path. This is more convenient for users as they don't need to specify full file paths.
Installed Package:
{
"mcpServers": {
"mcp-open-data-hk": {
"command": "python",
"args": ["-m", "mcp_open_data_hk"]
}
}
}Local Development (file path approach):
{
"mcpServers": {
"mcp-open-data-hk": {
"command": "python",
"args": ["-m", "src.mcp_open_data_hk"],
"cwd": "/full/path/to/mcp-open-data-hk"
}
}
}The package installation approach is recommended for end users, while the file path approach is useful for local development and testing.
Example Queries
Once installed, try these queries with your AI assistant:
"List some datasets from the Hong Kong government data portal via mcp-open-data-hk mcp."
"Find datasets related to transportation in Hong Kong. Use mcp-open-data-hk."
"What categories of data are available on DATA.GOV.HK? Use mcp-open-data-hk."
"Get details about the flight information dataset. Use mcp-open-data-hk."
"Search for datasets about weather in Hong Kong. Use mcp-open-data-hk."
"What file formats are supported by DATA.GOV.HK? Use mcp-open-data-hk."
"Find CSV datasets about population Use mcp-open-data-hk."
"Show me the most common tags in transport datasets Use mcp-open-data-hk."
The AI will automatically use the appropriate tools from your MCP server to fetch the requested information.
Troubleshooting
Common Issues
Module not found errors: Make sure you've installed the dependencies with
pip install -e .for local development, orpip install mcp-open-data-hkfor the published package.Path issues: Ensure the
cwdin your IDE configuration is the correct absolute path to the project root.Permission errors: On Unix systems, make sure the scripts have execute permissions:
chmod +x src/mcp_open_data_hk/__main__.pyFastMCP not found: Install it with:
pip install fastmcp
Testing the Connection
If you're having issues, you can test the connection manually:
Run the server in one terminal:
python -m src.mcp_open_data_hkIn another terminal, run the test client:
python tests/test_client.py
If this works, the issue is likely in the IDE configuration.
Extending the Server
You can extend the server by adding more tools in src/mcp_open_data_hk/server.py. Follow the existing patterns:
Add a new function decorated with
@mcp.toolProvide a clear docstring explaining the function and parameters
Implement the functionality
Test with the client
The server automatically exposes all functions decorated with @mcp.tool to MCP clients.
GitHub Workflows
This project includes GitHub Actions workflows for CI/CD:
CI Workflow: Runs tests across multiple Python versions (3.10-3.12) on every push/PR to main branch
Publish Workflow: Automatically builds and publishes to TestPyPI on every push to main, and to PyPI on version tags (v*.*.*)
Code Quality Workflow: Checks code formatting and linting on every push/PR
Release Workflow: Automatically creates GitHub releases when tags are pushed
Setup for Publishing (Trusted Publishing)
This project uses PyPI's Trusted Publishing which is more secure than using API tokens. To set it up:
Go to https://pypi.org/manage/account/publishing/ and add a new pending publisher with:
Project name:
mcp-open-data-hkOwner: Your GitHub username or organization
Repository name:
mcp-open-data-hkWorkflow name:
publish.ymlEnvironment name:
pypi
Go to https://test.pypi.org/manage/account/publishing/ and add a new pending publisher with the same information but use
testpypias the environment name.In your GitHub repository, go to "Settings" > "Environments" and create two environments:
pypi- Set "Required reviewers" to your username for securitytestpypi- No additional configuration needed
With Trusted Publishing, no API tokens need to be created or stored as secrets.
GitHub Environments
For the Trusted Publishing to work correctly, you need to create two environments in your GitHub repository settings:
pypi- This environment requires manual approval for security when publishing to PyPItestpypi- This environment doesn't require manual approval and will automatically publish to TestPyPI
To create these environments:
Go to your repository's "Settings" tab
Click on "Environments" in the left sidebar
Click "New environment"
Create the
pypienvironment and enable "Required reviewers" with your usernameCreate the
testpypienvironment with no additional settings
Releasing New Versions
To release a new version:
Update the version number in
pyproject.tomlCommit the changes
Create and push a new tag:
git tag -a v1.0.0 -m "Release version 1.0.0" git push origin v1.0.0
Or use the provided release script:
./release.sh 1.0.0This will automatically trigger the publish workflow to build and publish the package to TestPyPI and PyPI (for tagged releases), and create a GitHub release.
Contributing
Contributions are welcome! Please read our Contributing Guide and Code of Conduct for details on how to contribute to this project.
Project Structure
mcp-open-data-hk/
├── src/
│ └── mcp_open_data_hk/ # Main Python package
│ ├── __init__.py # Package initialization
│ ├── __main__.py # Package entry point
│ └── server.py # Main MCP server implementation
├── tests/
│ ├── test_client.py # Client test script
│ ├── debug_search.py # Search functionality test
│ ├── comprehensive_test.py # Comprehensive functionality test
│ └── test_data_gov_hk.py # Unit tests
├── requirements.txt # Python dependencies
├── pyproject.toml # Project configuration
├── README.md # This file
├── run_examples.sh # Example commands script
├── install.sh # Installation helper script
├── release.sh # Release helper script
└── .gitignore # Git ignore fileLicense
This project is licensed under the MIT License.
Available Tools
8 toolsget_category_detailsC
Get detailed information about a specific category (group)
| Name | Required | Description | Default |
|---|---|---|---|
| category_id | Yes | The ID or name of the category to retrieve | |
| include_datasets | No | Include a truncated list of the category's datasets | |
| include_dataset_count | No | Include the full package count | |
| include_extras | No | Include the category's extra fields | |
| include_users | No | Include the category's users | |
| include_groups | No | Include the category's sub groups | |
| include_tags | No | Include the category's tags | |
| include_followers | No | Include the category's number of followers | |
| language | No | Language code (en, tc, sc) | en |
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description should disclose behavioral traits. It only states the tool 'gets' information, which is read-only, but does not mention side effects, authentication requirements, or response characteristics beyond what the output schema covers.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, concise sentence that front-loads the core purpose. It is efficient but could benefit from additional context without sacrificing brevity.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool has 9 parameters and an output schema, the description is too sparse. It does not explain what 'detailed information' includes or how the boolean flags affect the result, leaving the agent to infer from the schema alone.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so the baseline is 3. The description adds no additional meaning to the parameters; it simply restates the tool's purpose.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool retrieves detailed information about a specific category, with the parenthetical '(group)' clarifying the resource. However, it does not explicitly distinguish itself from sibling tools like 'list_categories' which might also return category details but in a different manner.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is provided on when to use this tool versus alternatives like 'get_dataset_details' or 'list_categories'. The description lacks context on prerequisites or use cases.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_dataset_detailsB
Get detailed information about a specific dataset
| Name | Required | Description | Default |
|---|---|---|---|
| dataset_id | Yes | The ID or name of the dataset to retrieve | |
| language | No | Language code (en, tc, sc) | en |
| include_tracking | No | Add tracking information to dataset and resources |
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are present, so the description must carry the full burden. It implies a read-only operation via 'get', but lacks details on side effects, permissions, error behavior, or idempotency. This is insufficient for a tool with no annotation support.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, direct sentence that efficiently conveys the tool's purpose without any unnecessary words or details. Perfectly concise.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's simplicity (3 parameters) and the presence of an output schema, the description is minimally adequate. However, it lacks context about what 'detailed information' includes and when to prefer this over similar tools, leaving some ambiguity.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the schema already describes all parameters. The description adds no extra meaning beyond what the input schema provides. Baseline 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool retrieves detailed information about a specific dataset, using the verb 'get' and the resource 'dataset'. It distinguishes from siblings like 'list_datasets' and 'search_datasets', but could be more specific about what 'detailed information' includes.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is provided on when to use this tool versus alternatives (e.g., list_datasets, search_datasets). The description does not specify that it is for a single dataset or mention any prerequisites or context.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_datasets_by_formatA
Get datasets that have resources in a specific file format.
| Name | Required | Description | Default |
|---|---|---|---|
| file_format | Yes | The file format to filter by (e.g., "CSV", "JSON", "GeoJSON") | |
| limit | No | Maximum number of datasets to return | |
| language | No | Language code (en, tc, sc) | en |
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Without annotations, the description should disclose behavioral traits beyond the basic operation. It only states the core function (filtering by format) but omits details like pagination (implied by limit parameter), result ordering, or handling of missing data. Minimal transparency.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, concise sentence with no extraneous words. It is front-loaded with the action and result, making it easy to parse. Every word is necessary.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given that an output schema exists and parameter schema coverage is full, the description could be considered minimal but still lacks key context like pagination behavior, error responses, and differentiation from similar tools. It is adequate for a simple filter but not robust.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema already provides descriptions for all parameters (100% coverage), so the baseline is 3. The description adds no extra meaning beyond the schema, such as explaining valid file format values or case sensitivity. It does not leverage the opportunity to clarify parameter usage.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool retrieves datasets filtered by file format, distinguishing it from sibling tools like list_datasets (all datasets) or search_datasets (query-based). The verb 'Get' and resource 'datasets' with the condition 'in a specific file format' provide specific purpose.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No explicit guidance on when to use this tool versus alternatives such as search_datasets_with_facets or list_datasets. The description does not mention limitations, prerequisites, or scenarios where this tool is preferable, leaving the agent without decision support.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_supported_formatsA
Get a list of file formats supported by data.gov.hk
Returns: A list of supported file formats
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries full burden but only states it returns a list. It does not disclose if the tool is read-only, has rate limits, or other behavioral traits, leaving the agent uninformed.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Extremely concise with no waste. The action and resource are front-loaded in the first line, and the return is briefly noted.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The tool is simple with no parameters and an output schema present, so the description need not be exhaustive. However, it vaguely mentions 'a list of supported file formats' without specifying format types, leaving some ambiguity.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
No parameters exist, so baseline 4 applies. The description adds no param info but is not required; schema coverage is 100% with zero parameters.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action ('Get a list of file formats') and the resource ('supported by data.gov.hk'), making it distinct from sibling tools that deal with datasets and categories.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is provided on when to use this tool versus alternatives, though its simplicity may imply standalone use. Explicit context would improve decision-making.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_categoriesC
Get a list of data categories (groups)
| Name | Required | Description | Default |
|---|---|---|---|
| order_by | No | Field to sort by ('name' or 'packages') - deprecated, use sort instead | name |
| sort | No | Sorting of results ('name asc', 'package_count desc', etc.) | title asc |
| limit | No | Maximum number of categories to return | |
| offset | No | Offset for pagination | |
| all_fields | No | Return full group dictionaries instead of just names | |
| language | No | Language code (en, tc, sc) | en |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations exist, and the description does not disclose behavioral traits such as whether the tool is read-only, pagination defaults, or what happens when no categories exist. It only states 'get a list,' leaving many behavioral details implicit.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single concise sentence with no redundancy, but it is minimal. It achieves its purpose without extra words, though it could include more context without becoming verbose.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the high schema coverage and no output schema, the description is somewhat complete for listing categories. However, it omits information about the return format (when all_fields is used) and how this fits into the overall API.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema descriptions cover all 6 parameters with details like defaults and deprecation, so the description adds no additional semantic value. With 100% schema coverage, a baseline score of 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool returns a list of data categories, using the verb 'get' and specifying the resource. However, it does not distinguish itself from sibling tools like list_datasets or explain what 'groups' means.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is provided on when to use this tool versus alternatives (e.g., get_category_details for a single category, list_datasets for datasets). The description lacks context for appropriate usage.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_datasetsB
Get a list of dataset IDs from data.gov.hk
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum number of datasets to return (default: 1000) | |
| offset | No | Offset of the first dataset to return | |
| language | No | Language code (en, tc, sc) | en |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
The description does not disclose behavioral traits such as pagination behavior, default ordering, or the effect of the language parameter. Since no annotations are present, the description carries full burden and is insufficient.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is concise with a single sentence that front-loads the purpose. However, it could include slightly more context without becoming verbose.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool has three optional parameters and an output schema, the description lacks information about pagination, default ordering, or how language affects the result. This is insufficient for a list operation.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so a baseline of 3 is appropriate. The tool description does not add any meaning beyond what the schema already provides (e.g., limit max, offset behavior).
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the verb 'Get', the resource 'list of dataset IDs', and the source 'data.gov.hk'. It sufficiently distinguishes from siblings like get_dataset_details or search_datasets, which have different purposes.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is provided on when to use this tool versus alternatives such as search_datasets or list_categories. An agent would lack context for appropriate invocation.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
search_datasetsC
Search for datasets by query term using the package_search API.
This function searches across dataset titles, descriptions, and other metadata to find datasets matching the query term.
| Name | Required | Description | Default |
|---|---|---|---|
| query | No | The solr query string (e.g., "transport", "weather", "*:*" for all) | *:* |
| limit | No | Maximum number of datasets to return (default: 10, max: 1000) | |
| offset | No | Offset for pagination | |
| language | No | Language code (en, tc, sc) | en |
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden. It reveals that the tool uses the package_search API and searches across metadata fields, but it does not disclose behavioral traits like pagination behavior, rate limits, or what happens with excess parameters. The output is not described despite an output schema existing.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is exceptionally concise: two sentences that effectively state the purpose and the scope of search. No redundant information.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Despite having an output schema and 100% schema coverage, the description omits important contextual details such as pagination (limit/offset), language filtering, and the fact that all parameters are optional. It does not prepare the agent for how to handle large result sets or filter by language.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has 100% description coverage, providing clear parameter definitions. The tool description adds some context (e.g., 'searches across dataset titles, descriptions, and other metadata') but does not significantly enhance parameter understanding beyond the schema. Baseline score of 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool searches for datasets by query term using the package_search API. It specifies the scope (titles, descriptions, metadata). However, it does not explicitly differentiate from sibling tools like search_datasets_with_facets, which may perform similar but richer searches.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives, such as search_datasets_with_facets or list_datasets. It does not mention ideal scenarios, prerequisites, or when not to use it.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
search_datasets_with_facetsB
Search for datasets and return faceted results for better data exploration.
| Name | Required | Description | Default |
|---|---|---|---|
| query | No | The solr query string | *:* |
| language | No | Language code (en, tc, sc) | en |
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden. It only states it returns faceted results but provides no details on the facets themselves, limitations, or safety (read-only). The output schema exists but is not referenced.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single sentence, concise and front-loaded. However, at only 13 words for a complex faceted search tool, it may be too brief to be fully informative.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The tool has an output schema, so return values are covered. However, the description lacks context on how to interpret facets or the range of possible queries. Given the sibling tools like list_categories, some cross-reference could help.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Both parameters have descriptions in the schema covering 100% coverage. The description adds no extra semantic meaning beyond the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool 'Search for datasets' and specifies the unique feature 'return faceted results for better data exploration.' This distinguishes it from the sibling 'search_datasets' which likely returns non-faceted results.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage for data exploration with faceted results, but does not explicitly state when to use this tool over 'search_datasets' or any other sibling. No mention of prerequisites or scenarios.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
8 tool updates
v0.2.3- Changed
get_category_details10 fields changed- added
Input schema / additionalPropertiesAdded value: +false - added
Input schema / properties / category_id / descriptionAdded value: +"The ID or name of the category to retrieve" - added
Input schema / properties / include_dataset_count / descriptionAdded value: +"Include the full package count" - added
Input schema / properties / include_datasets / descriptionAdded value: +"Include a truncated list of the category's datasets" - added
Input schema / properties / include_extras / descriptionAdded value: +"Include the category's extra fields" - added
Input schema / properties / include_followers / descriptionAdded value: +"Include the category's number of followers" - added
Input schema / properties / include_groups / descriptionAdded value: +"Include the category's sub groups" - added
Input schema / properties / include_tags / descriptionAdded value: +"Include the category's tags" - added
Input schema / properties / include_users / descriptionAdded value: +"Include the category's users" - added
Input schema / properties / language / descriptionAdded value: +"Language code (en, tc, sc)"
- Changed
get_dataset_details4 fields changed- added
Input schema / additionalPropertiesAdded value: +false - added
Input schema / properties / dataset_id / descriptionAdded value: +"The ID or name of the dataset to retrieve" - added
Input schema / properties / include_tracking / descriptionAdded value: +"Add tracking information to dataset and resources" - added
Input schema / properties / language / descriptionAdded value: +"Language code (en, tc, sc)"
- Changed
get_datasets_by_format4 fields changed- added
Input schema / additionalPropertiesAdded value: +false - added
Input schema / properties / file_format / descriptionAdded value: +"The file format to filter by (e.g., \"CSV\", \"JSON\", \"GeoJSON\")" - added
Input schema / properties / language / descriptionAdded value: +"Language code (en, tc, sc)" - added
Input schema / properties / limit / descriptionAdded value: +"Maximum number of datasets to return"
- Changed
get_supported_formats1 field changed- added
Input schema / additionalPropertiesAdded value: +false
- Changed
list_categories7 fields changed- added
Input schema / additionalPropertiesAdded value: +false - added
Input schema / properties / all_fields / descriptionAdded value: +"Return full group dictionaries instead of just names" - added
Input schema / properties / language / descriptionAdded value: +"Language code (en, tc, sc)" - added
Input schema / properties / limit / descriptionAdded value: +"Maximum number of categories to return" - added
Input schema / properties / offset / descriptionAdded value: +"Offset for pagination" - added
Input schema / properties / order_by / descriptionAdded value: +"Field to sort by ('name' or 'packages') - deprecated, use sort instead" - added
Input schema / properties / sort / descriptionAdded value: +"Sorting of results ('name asc', 'package_count desc', etc.)"
- Changed
list_datasets4 fields changed- added
Input schema / additionalPropertiesAdded value: +false - added
Input schema / properties / language / descriptionAdded value: +"Language code (en, tc, sc)" - added
Input schema / properties / limit / descriptionAdded value: +"Maximum number of datasets to return (default: 1000)" - added
Input schema / properties / offset / descriptionAdded value: +"Offset of the first dataset to return"
- Changed
search_datasets5 fields changed- added
Input schema / additionalPropertiesAdded value: +false - added
Input schema / properties / language / descriptionAdded value: +"Language code (en, tc, sc)" - added
Input schema / properties / limit / descriptionAdded value: +"Maximum number of datasets to return (default: 10, max: 1000)" - added
Input schema / properties / offset / descriptionAdded value: +"Offset for pagination" - added
Input schema / properties / query / descriptionAdded value: +"The solr query string (e.g., \"transport\", \"weather\", \"*:*\" for all)"
- Changed
search_datasets_with_facets3 fields changed- added
Input schema / additionalPropertiesAdded value: +false - added
Input schema / properties / language / descriptionAdded value: +"Language code (en, tc, sc)" - added
Input schema / properties / query / descriptionAdded value: +"The solr query string"
8 tool updates
- First observed
get_category_details - First observed
get_dataset_details - First observed
get_datasets_by_format - First observed
get_supported_formats - First observed
list_categories - First observed
list_datasets - First observed
search_datasets - First observed
search_datasets_with_facets
TDQS
Scored across 8 tools
Each tool has a clearly distinct purpose: categories, datasets, formats, and search are separate concerns. Overlap between get_datasets_by_format and search_datasets is minimized by specific parameters and descriptions.
All tools follow a consistent verb_noun pattern (get, list, search) with descriptive nouns, all using snake_case. No mixing of conventions or ambiguous verbs.
8 tools is well-scoped for an open data portal, covering essential operations: browsing categories, listing/searching datasets, getting details, and checking formats. Each tool serves a clear purpose without redundancy.
The set covers core CRUD-like operations for dataset discovery. Minor gap: no tool for retrieving resource download URLs or filtering datasets beyond format, but the search and details tools likely include that data.
Maintenance
Related MCP Connectors
Hong Kong Census and Statistics Department (C&SD) open-data MCP.
Hong Kong Companies Registry open data — company/BR-number search, new registrations & name changes
This MCP server provides seamless access to Malaysia's government open data, including datasets, w…
Hong Kong Monetary Authority (HKMA) public open API MCP. Keyless.
Related MCP Servers
- AlicenseBqualityDmaintenanceProvides access to Hong Kong Observatory weather data APIs, enabling retrieval of forecasts, earthquake info, tide data, and more via natural language.202MIT
- AlicenseAqualityCmaintenanceEnables querying of Hong Kong government data on elderly community care services, such as waiting times and applicant counts.11MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI assistants to search and read Thailand's official open-government data from data.go.th, providing tools to search datasets, retrieve full records, and browse categories without API keys.MIT
- AlicenseNot gradedqualityBmaintenanceEnables querying Hong Kong Government procurement contracts awarded data through natural language, with no API key required.4 npmMIT