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';
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It mentions fetching data but lacks details on behavioral traits such as authentication requirements, rate limits, error handling, or response format. This is a significant gap for a tool that interacts with an external API, making it inadequate for informed use.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's purpose without unnecessary words. It is front-loaded and appropriately sized, making it easy for an agent to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of fetching data from an external API, no annotations, and no output schema, the description is incomplete. It doesn't cover key aspects like authentication, rate limits, error responses, or data format, leaving the agent with insufficient context for reliable use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents both parameters ('id' and 'limit') with clear descriptions. The description adds no additional meaning beyond what the schema provides, such as examples or constraints, but the baseline is 3 since the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('fetch') and resource ('actual data from the data.gov.my API for a specific catalogue'), distinguishing it from siblings like 'get_catalogue_metadata' (metadata vs. data) and 'list_catalogue_ids' (list IDs vs. fetch data). However, it doesn't explicitly differentiate from 'search_catalogues', which might also fetch data but with search capabilities.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives like 'search_catalogues' or 'get_catalogue_metadata'. The description implies usage for fetching data for a specific catalogue, but it doesn't specify prerequisites, exclusions, or contextual recommendations, leaving the agent to infer usage scenarios.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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