getEconomicBlocks
Retrieve economic block data by specifying language, additional details, and search criteria. Use this tool to analyze and access structured trade and economic information efficiently.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| add | No | ||
| language | No | pt | |
| search | No |
Implementation Reference
- src/ComexstatMCP.ts:408-424 (registration)Registration of the 'getEconomicBlocks' MCP tool, including input schema and handler function."getEconomicBlocks", { language: z.string().optional().default("pt"), add: z.string().optional(), search: z.string().optional(), }, async ({ language, add, search }) => ({ content: [ { type: "text", text: JSON.stringify( await this.client.getEconomicBlocks({ language, add, search }) ), }, ], }) );
- src/ComexstatMCP.ts:415-424 (handler)Handler function for the 'getEconomicBlocks' tool that calls the client method and formats response as MCP content.content: [ { type: "text", text: JSON.stringify( await this.client.getEconomicBlocks({ language, add, search }) ), }, ], }) );
- src/ComexstatMCP.ts:410-414 (schema)Input schema (Zod) for the 'getEconomicBlocks' tool defining optional parameters.language: z.string().optional().default("pt"), add: z.string().optional(), search: z.string().optional(), }, async ({ language, add, search }) => ({
- src/ComexstatClient.ts:591-611 (helper)Helper method in ComexstatClient that performs the actual API GET request to '/tables/economic-blocks' with options and defines response type.async getEconomicBlocks(options?: { language?: string; add?: string; search?: string; }): Promise<{ data: { list: Array<{ economicBlock: string; country?: string; coBlock: string; coCountry?: string; }>; count: number; }; success: boolean; message: string | null; processo_info: any; language: string; }> { return this.get("/tables/economic-blocks", options); }