list_catalogue_ids
Retrieve available data catalogue IDs from the Data.gov.my MCP Server to access Malaysia's government open datasets directly from the GitHub repository.
Instructions
Fetch list of available data catalogue IDs from GitHub repository.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:122-147 (handler)Implements the core logic for the 'list_catalogue_ids' tool: fetches the contents of the data-catalogue directory from the GitHub repository, filters for JSON files, extracts IDs, and returns a JSON-formatted list.if (name === 'list_catalogue_ids') { console.error('[GitHub] Fetching catalogue list from GitHub...'); const response = await this.githubAxios.get('/repos/data-gov-my/datagovmy-meta/contents/data-catalogue'); const catalogues = (response.data as GitHubFile[]) .filter((item: GitHubFile) => item.type === 'file' && item.name.endsWith('.json')) .map((item: GitHubFile) => ({ id: item.name.replace('.json', ''), name: item.name, download_url: item.download_url, size: item.size })); return { content: [ { type: 'text', text: JSON.stringify({ catalogues, count: catalogues.length, message: 'Catalogue IDs fetched successfully from GitHub.' }, null, 2), }, ], };
- src/index.ts:77-81 (registration)Registers the 'list_catalogue_ids' tool in the MCP server's listTools response, including name, description, and schema for no input parameters.{ name: 'list_catalogue_ids', description: 'Fetch list of available data catalogue IDs from GitHub repository.', inputSchema: { type: 'object', properties: {}, required: [] }, },
- src/index.ts:79-81 (schema)Defines the input schema for 'list_catalogue_ids' tool as an empty object (no parameters required).description: 'Fetch list of available data catalogue IDs from GitHub repository.', inputSchema: { type: 'object', properties: {}, required: [] }, },