getCityDetails
Retrieve detailed information about a specific city using its unique cityId. Ideal for applications requiring precise city data integration.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cityId | Yes |
Implementation Reference
- src/ComexstatClient.ts:532-545 (handler)Core handler function that fetches and returns city details from the Comexstat API endpoint `/tables/cities/${cityId}`.async getCityDetails(cityId: string): Promise<{ data: { coMunGeo: string; // Geographic municipality code noMun: string; // Municipality name noMunMin: string; // Short municipality name sgUf: string; // State abbreviation }; success: boolean; message: string | null; processo_info: any; language: string; }> { return this.get(`/tables/cities/${cityId}`); }
- src/ComexstatMCP.ts:359-361 (schema)Input schema validation using Zod for the cityId parameter.{ cityId: z.string(), },
- src/ComexstatMCP.ts:358-370 (registration)Registers the MCP tool 'getCityDetails' with input schema and a handler that delegates to ComexstatClient.getCityDetails and returns JSON response."getCityDetails", { cityId: z.string(), }, async ({ cityId }) => ({ content: [ { type: "text", text: JSON.stringify(await this.client.getCityDetails(cityId)), }, ], }) );