get_catalogue_data
Fetch dataset records from Malaysia's official government data catalogue using a specific dataset ID to access structured government data.
Instructions
Fetch actual data from the data.gov.my API for a specific catalogue.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | ID of the dataset | |
| limit | No | Number of records to fetch (optional, default 100) |
Implementation Reference
- src/index.ts:173-195 (handler)Handler function that executes the 'get_catalogue_data' tool logic: validates args, makes API call to data.gov.my /data-catalogue endpoint with id and optional limit, returns JSON data as text content.} else if (name === 'get_catalogue_data') { if (!isCatalogueArgs(args)) { throw new McpError(ErrorCode.InvalidParams, 'Missing required parameter: id'); } console.error(`[API] Fetching catalogue data for: ${args.id}`); const params: any = { id: args.id }; if (args.limit) params.limit = args.limit; const response = await this.axiosInstance.get('/data-catalogue', { params }); return { content: [ { type: 'text', text: JSON.stringify({ id: args.id, data: response.data, message: 'Catalogue data fetched successfully.' }, null, 2), }, ], };
- src/index.ts:93-104 (registration)Registration of the 'get_catalogue_data' tool in the ListTools handler, including name, description, and input schema.{ name: 'get_catalogue_data', description: 'Fetch actual data from the data.gov.my API for a specific catalogue.', inputSchema: { type: 'object', properties: { id: { type: 'string', description: 'ID of the dataset' }, limit: { type: 'number', description: 'Number of records to fetch (optional, default 100)' } }, required: ['id'], }, },
- src/index.ts:20-23 (schema)Type definition (schema) for the input arguments of 'get_catalogue_data' tool.interface CatalogueArgs { id: string; limit?: number; }
- src/index.ts:30-32 (helper)Type guard helper function used to validate input arguments for 'get_catalogue_data' tool.function isCatalogueArgs(args: any): args is CatalogueArgs { return args && typeof args.id === 'string'; }