getStateDetails
Retrieve detailed state information by providing a unique UF ID using the MCP server mcp-comexstat. Simplifies access to essential state data for analysis or integration.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ufId | Yes |
Implementation Reference
- src/ComexstatMCP.ts:336-343 (handler)The MCP tool handler function for getStateDetails, which receives ufId parameter, calls this.client.getStateDetails(ufId), stringifies the result as JSON, and returns it wrapped in MCP content format.async ({ ufId }) => ({ content: [ { type: "text", text: JSON.stringify(await this.client.getStateDetails(ufId)), }, ], })
- src/ComexstatMCP.ts:331-344 (registration)Registration of the getStateDetails MCP tool using this.server.tool, specifying the tool name, input schema, and handler function.this.server.tool( "getStateDetails", { ufId: z.string(), }, async ({ ufId }) => ({ content: [ { type: "text", text: JSON.stringify(await this.client.getStateDetails(ufId)), }, ], }) );
- src/ComexstatMCP.ts:333-335 (schema)Input schema definition for the getStateDetails tool using Zod (z.string() for ufId).{ ufId: z.string(), },
- src/ComexstatClient.ts:498-511 (helper)Supporting client method that implements the core logic for fetching state details from the API endpoint `/tables/uf/${ufId}`, returning structured data including state code, abbreviation, name, and region.async getStateDetails(ufId: string): Promise<{ data: { coUf: string; // State code sgUf: string; // State abbreviation noUf: string; // State name noRegiao: string; // Region name }; success: boolean; message: string | null; processo_info: any; language: string; }> { return this.get(`/tables/uf/${ufId}`); }