incoterms_lookup
Look up Incoterms 2020 to explain trade terms, compare seller and buyer responsibilities, and identify risk and cost transfer points per transport mode.
Instructions
Look up Incoterms 2020 trade rules.
Incoterms define who pays for what in international trade — transport, insurance, customs clearance, and risk transfer. There are 11 rules: 7 for any transport mode (EXW, FCA, CPT, CIP, DAP, DPU, DDP) and 4 for sea/inland waterway only (FAS, FOB, CFR, CIF).
Use this tool when you need to:
Explain what an Incoterm means (e.g., "What does FOB mean?")
Compare seller vs buyer responsibilities
Determine risk and cost transfer points
Check which Incoterms apply to sea freight vs any mode
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | No | Incoterm code (e.g., "FOB", "CIF", "EXW") | |
| category | No | Filter by transport mode category |
Implementation Reference
- src/tools.ts:311-332 (handler)The incoterms_lookup tool definition including the handler function that calls apiGet('incoterms', ...) with code and category parameters.
const incotermsLookup: ToolDef = { name: 'incoterms_lookup', description: `Look up Incoterms 2020 trade rules. Incoterms define who pays for what in international trade — transport, insurance, customs clearance, and risk transfer. There are 11 rules: 7 for any transport mode (EXW, FCA, CPT, CIP, DAP, DPU, DDP) and 4 for sea/inland waterway only (FAS, FOB, CFR, CIF). Use this tool when you need to: - Explain what an Incoterm means (e.g., "What does FOB mean?") - Compare seller vs buyer responsibilities - Determine risk and cost transfer points - Check which Incoterms apply to sea freight vs any mode`, schema: z.object({ code: z.string().optional().describe('Incoterm code (e.g., "FOB", "CIF", "EXW")'), category: z.enum(['any_mode', 'sea_only']).optional().describe('Filter by transport mode category'), }).strict(), annotations: readOnlyAnnotations('Incoterms 2020 Lookup'), handler: async (args) => apiGet('incoterms', { code: args.code, category: args.category }), }; - src/tools.ts:323-326 (schema)Zod validation schema for incoterms_lookup: accepts optional 'code' (string) and optional 'category' (enum: any_mode or sea_only).
schema: z.object({ code: z.string().optional().describe('Incoterm code (e.g., "FOB", "CIF", "EXW")'), category: z.enum(['any_mode', 'sea_only']).optional().describe('Filter by transport mode category'), }).strict(), - src/tools.ts:713-733 (registration)The ALL_TOOLS array that exports all tool definitions, including incotermsLookup at line 723, which is iterated over in server.ts for MCP registration.
export const ALL_TOOLS: ToolDef[] = [ cbmCalculator, chargeableWeightCalculator, ldmCalculator, adrLookup, adrExemptionCalculator, adrLqEqCheck, airlineLookup, containerLookup, hsCodeLookup, incotermsLookup, palletFittingCalculator, unitConverter, consignmentCalculator, unlocodeLookup, ukDutyCalculator, shipmentSummary, uldLookup, vehicleLookup, getSubscribeLink, ]; - src/server.ts:19-42 (registration)The MCP server registration loop that iterates ALL_TOOLS and registers each tool via server.tool().
for (const tool of ALL_TOOLS) { server.tool( tool.name, tool.description, tool.schema.shape, tool.annotations, async (args: Record<string, unknown>) => { try { const result = await tool.handler(args); return { content: [ { type: 'text' as const, text: JSON.stringify(result, null, 2) }, ], }; } catch (err: unknown) { const message = err instanceof Error ? err.message : String(err); return { content: [{ type: 'text' as const, text: `Error: ${message}` }], isError: true, }; } }, ); } - src/tools.ts:16-24 (helper)The ToolDef interface and ToolAnnotationShape type used to define the shape of tool definitions including incotermsLookup.
export interface ToolDef { name: string; description: string; // Allow any ZodObject (including .strict() variants) so individual tools // can opt into strict-key enforcement without breaking the shared type. schema: z.AnyZodObject; annotations: ToolAnnotationShape; handler: (args: Record<string, unknown>) => Promise<unknown>; }