adr_exemption_calculator
Calculate ADR 1.1.3.6 exemption points for mixed hazardous loads to check if small load exemption applies. Accepts single substance or multiple items.
Instructions
Calculate ADR 1.1.3.6 exemption thresholds for mixed hazardous loads.
ADR 1.1.3.6 allows reduced requirements when the total "points" of a mixed load are 1,000 or below. Each substance is assigned to a transport category (0-4) with a multiplier. Points = quantity x multiplier.
Use this tool when you need to:
Check if a load of dangerous goods qualifies for the small load exemption
Calculate total ADR points for a mixed load
Determine if full ADR compliance is required
For single substances, provide un_number + quantity. For mixed loads, use the items array.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| un_number | No | UN number for single-substance check | |
| quantity | No | Quantity in kg or litres for single-substance check | |
| items | No | Array of items for mixed-load calculation (use instead of single un_number/quantity) |
Implementation Reference
- src/tools.ts:202-208 (handler)The handler function for adr_exemption_calculator. It calls apiPost with items for mixed loads or apiGet with single UN/quantity.
handler: async (args) => { if (args.items) { return apiPost('adr-calculator', { items: args.items }); } return apiGet('adr-calculator', { un: args.un_number, qty: args.quantity }); }, }; - src/tools.ts:191-198 (schema)Zod schema defining the input: optional un_number + quantity for single substances, or optional items array for mixed loads.
schema: z.object({ un_number: z.string().regex(/^(UN)?\d{4}$/i, 'UN number must be 4 digits, optionally prefixed with "UN"').optional().describe('UN number for single-substance check'), quantity: z.number().positive().optional().describe('Quantity in kg or litres for single-substance check'), items: z.array(z.object({ un_number: z.string().regex(/^(UN)?\d{4}$/i, 'UN number must be 4 digits, optionally prefixed with "UN"').describe('UN number'), quantity: z.number().positive().describe('Quantity in kg or litres'), })).optional().describe('Array of items for mixed-load calculation (use instead of single un_number/quantity)'), }).strict(), - src/server.ts:19-41 (registration)The adrExemptionCalculator tool is registered via ALL_TOOLS array iteration in createServer().
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:713-733 (registration)ALL_TOOLS array where adrExemptionCalculator is exported at index 4.
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/api.ts:26-39 (helper)apiPost helper used by the handler to POST to 'adr-calculator' endpoint with items array.
export async function apiPost(endpoint: string, body: unknown): Promise<unknown> { const res = await fetch(`${BASE_URL}/${endpoint}`, { method: 'POST', headers: { 'Content-Type': 'application/json', 'Accept': 'application/json' }, body: JSON.stringify(body), }); if (!res.ok) { const text = await res.text(); throw new Error(`FreightUtils API error ${res.status}: ${text}`); } return res.json(); }