list_catalogue_ids
Fetch available data catalogue IDs from Malaysia's government open data platform to discover and access datasets programmatically.
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)Handler function for the 'list_catalogue_ids' tool. Fetches list of JSON files from the GitHub repository 'data-gov-my/datagovmy-meta/contents/data-catalogue', extracts catalogue IDs, and returns them as JSON.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)Registration of the 'list_catalogue_ids' tool in the MCP server's tool list, including name, description, and empty input schema.{ name: 'list_catalogue_ids', description: 'Fetch list of available data catalogue IDs from GitHub repository.', inputSchema: { type: 'object', properties: {}, required: [] }, },
- src/index.ts:80-80 (schema)Input schema for 'list_catalogue_ids' tool: an empty object (no parameters required).inputSchema: { type: 'object', properties: {}, required: [] },