Skip to main content
Glama
manfye

Data.gov.my MCP Server

by manfye

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
NameRequiredDescriptionDefault
idYesID of the dataset
limitNoNumber of records to fetch (optional, default 100)

Implementation Reference

  • 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'],
      },
    },
  • Type definition (schema) for the input arguments of 'get_catalogue_data' tool.
    interface CatalogueArgs {
      id: string;
      limit?: number;
    }
  • 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';
    }

Tool Definition Quality

Score is being calculated. Check back soon.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/manfye/data-dosm-mcp-nodejs'

If you have feedback or need assistance with the MCP directory API, please join our Discord server