get_catalogue_metadata
Fetch metadata for a specific dataset from Malaysia's official government data catalogue using its unique ID to access detailed information.
Instructions
Fetch metadata for a specific data catalogue by ID from GitHub.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | ID of the dataset (e.g., "air_pollution", "population") |
Implementation Reference
- src/index.ts:148-172 (handler)The handler function for 'get_catalogue_metadata' tool. Validates input, fetches JSON metadata from GitHub repo 'data-gov-my/datagovmy-meta', decodes base64 content, parses it, and returns formatted text content with the metadata.} else if (name === 'get_catalogue_metadata') { if (!isCatalogueArgs(args)) { throw new McpError(ErrorCode.InvalidParams, 'Missing required parameter: id'); } console.error(`[GitHub] Fetching catalogue metadata for: ${args.id}`); const response = await this.githubAxios.get(`/repos/data-gov-my/datagovmy-meta/contents/data-catalogue/${args.id}.json`); // Decode the base64 content const content = Buffer.from(response.data.content, 'base64').toString('utf-8'); const metadata = JSON.parse(content); return { content: [ { type: 'text', text: JSON.stringify({ id: args.id, metadata, message: 'Catalogue metadata fetched successfully.' }, null, 2), }, ], };
- src/index.ts:83-92 (registration)Registration of the 'get_catalogue_metadata' tool in the ListTools response, including name, description, and input schema definition.name: 'get_catalogue_metadata', description: 'Fetch metadata for a specific data catalogue by ID from GitHub. do this before getting the data, if "exclude_openapi": true, mean you cant get the catalogue data. update the user on this and recommend them to get from manual csv.', inputSchema: { type: 'object', properties: { id: { type: 'string', description: 'ID of the dataset (e.g., "air_pollution", "population")' } }, required: ['id'], }, },
- src/index.ts:86-91 (schema)Input schema definition for the 'get_catalogue_metadata' tool, specifying the required 'id' parameter.type: 'object', properties: { id: { type: 'string', description: 'ID of the dataset (e.g., "air_pollution", "population")' } }, required: ['id'], },