Skip to main content
Glama
manfye

Data.gov.my MCP Server

by manfye

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
NameRequiredDescriptionDefault
idYesID of the dataset (e.g., "air_pollution", "population")

Implementation Reference

  • 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'],
      },
    },
  • 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'],
    },

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