Skip to main content
Glama
melaodoidao

Data.gov MCP Server

by melaodoidao

tag_list

Search and list tags on Data.gov to organize and manage dataset metadata effectively. Use the tool to filter tags by query or retrieve all fields for comprehensive results.

Instructions

List tags on Data.gov

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
all_fieldsNoReturn all fields
queryNoSearch query for tags

Implementation Reference

  • The handler function that implements the core logic of the 'tag_list' tool by querying the Data.gov API at '/action/tag_list' endpoint and formatting the response as MCP content.
    private async tagList(args: TagListArgs) { try { const response = await this.axiosInstance.get('/action/tag_list', { params: args, }); return { content: [{ type: 'text', text: JSON.stringify(response.data, null, 2) }], }; } catch (error) { return this.handleAxiosError(error); } }
  • TypeScript interface defining the input arguments for the tag_list tool.
    interface TagListArgs { query?: string; all_fields?: boolean; }
  • Type guard function to validate input arguments for the tag_list tool.
    const isValidTagListArgs = (args: any): args is TagListArgs => typeof args === 'object' && args !== null && (args.query === undefined || typeof args.query === 'string') && (args.all_fields === undefined || typeof args.all_fields === 'boolean');
  • src/index.ts:244-257 (registration)
    Registration of the 'tag_list' tool in the ListTools response, including name, description, and input schema.
    { name: 'tag_list', description: 'List tags on Data.gov', inputSchema: { type: 'object', properties: { query: { type: 'string', description: 'Search query for tags' }, all_fields: { type: 'boolean', description: 'Return all fields', }, }, }, },
  • src/index.ts:287-294 (registration)
    Dispatch logic in the CallTool handler that validates arguments and invokes the tagList method.
    case 'tag_list': if (!isValidTagListArgs(request.params.arguments)) { throw new McpError( ErrorCode.InvalidParams, 'Invalid tag_list arguments' ); } return this.tagList(request.params.arguments);
Install Server

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/melaodoidao/datagov-mcp-server'

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