package_show
Retrieve detailed information about a specific dataset by entering its ID or name on the Data.gov MCP Server.
Instructions
Get details for a specific package (dataset)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Package ID or name |
Implementation Reference
- src/index.ts:329-342 (handler)The main handler function for the package_show tool. It performs an HTTP GET request to the Data.gov API endpoint '/action/package_show' using the provided package ID and returns the response as formatted JSON text content.private async packageShow(args: PackageShowArgs) { try { const response = await this.axiosInstance.get('/action/package_show', { params: { id: args.id }, }); return { content: [ { type: 'text', text: JSON.stringify(response.data, null, 2) }, ], }; } catch (error) { return this.handleAxiosError(error); } }
- src/index.ts:41-53 (schema)TypeScript interface defining the input arguments for package_show (requiring 'id' string) and the corresponding validation function isValidPackageShowArgs.* Arguments for the package_show tool. */ interface PackageShowArgs { id: string; } /** * Checks if the given arguments are valid for the package_show tool. * @param args The arguments to validate. * @returns True if the arguments are valid, false otherwise. */ const isValidPackageShowArgs = (args: any): args is PackageShowArgs => typeof args === 'object' && args !== null && typeof args.id === 'string';
- src/index.ts:221-230 (registration)Tool registration in the ListToolsRequestSchema response, defining the name, description, and input schema (object with required 'id' string).name: 'package_show', description: 'Get details for a specific package (dataset)', inputSchema: { type: 'object', properties: { id: { type: 'string', description: 'Package ID or name' }, }, required: ['id'], }, },
- src/index.ts:271-278 (registration)Dispatch handler in the CallToolRequestSchema switch statement that validates the arguments using isValidPackageShowArgs and invokes the packageShow method.case 'package_show': if (!isValidPackageShowArgs(request.params.arguments)) { throw new McpError( ErrorCode.InvalidParams, 'Invalid package_show arguments' ); } return this.packageShow(request.params.arguments);