Skip to main content
Glama
manfye

Data.gov.my MCP Server

by manfye

get_catalogue_data

Fetch specific dataset information from Malaysia's open government data platform using a unique ID, with optional record limits, via Data.gov.my MCP Server.

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

  • Executes the get_catalogue_data tool: validates args with isCatalogueArgs, logs the request, constructs params with id and optional limit, fetches data from 'https://api.data.gov.my/data-catalogue', and returns JSON response with data.
    } 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), }, ], };
  • Input schema for get_catalogue_data: requires 'id' string, optional 'limit' number.
    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:93-104 (registration)
    Registers the get_catalogue_data tool in the tools list returned by list_tools, 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 guard helper to validate if arguments match CatalogueArgs interface (has 'id' string), used in get_catalogue_data handler.
    function isCatalogueArgs(args: any): args is CatalogueArgs { return args && typeof args.id === 'string'; }
  • Type definition for CatalogueArgs used in get_catalogue_data input validation.
    interface CatalogueArgs { id: string; limit?: number;

Other Tools

Related 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