getNBMDetails
Retrieve detailed information about a specific NBM code using the coNbm input for accurate trade classification and compliance checks.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| coNbm | Yes |
Implementation Reference
- src/ComexstatMCP.ts:480-487 (handler)The handler function for the 'getNBMDetails' MCP tool. It takes coNbm as input, fetches details using the client, stringifies the result to JSON, and returns it as text content.
async ({ coNbm }) => ({ content: [ { type: "text", text: JSON.stringify(await this.client.getNBMDetails(coNbm)), }, ], }) - src/ComexstatMCP.ts:477-479 (schema)Input schema for the 'getNBMDetails' tool, defining coNbm as a required string using Zod.
{ coNbm: z.string(), }, - src/ComexstatMCP.ts:475-488 (registration)Registration of the 'getNBMDetails' MCP tool on the server using server.tool(name, schema, handler).
this.server.tool( "getNBMDetails", { coNbm: z.string(), }, async ({ coNbm }) => ({ content: [ { type: "text", text: JSON.stringify(await this.client.getNBMDetails(coNbm)), }, ], }) ); - src/ComexstatClient.ts:690-701 (helper)Helper method in ComexstatClient that implements the API call to retrieve NBM details for a given coNbm code.
async getNBMDetails(coNbm: string): Promise<{ data: Array<{ coNBM: string; // NBM code noNBM: string; // NBM description }>; success: boolean; message: string | null; processo_info: any; language: string; }> { return this.get(`/tables/nbm/${coNbm}`); }