Skip to main content
Glama
SoapyRED

FreightUtils MCP Server

adr_exemption_calculator

Read-onlyIdempotent

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

TableJSON Schema
NameRequiredDescriptionDefault
un_numberNoUN number for single-substance check
quantityNoQuantity in kg or litres for single-substance check
itemsNoArray of items for mixed-load calculation (use instead of single un_number/quantity)

Implementation Reference

  • 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 });
      },
    };
  • 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,
    ];
  • 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();
    }
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint=true, destructiveHint=false, and idempotentHint=true. The description adds behavioral context by explaining the calculation logic: 'Points = quantity x multiplier' and the transport category system. This goes beyond annotations by clarifying how the tool processes input. No contradictions with annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured: a concise first sentence stating purpose, followed by a brief explanation of ADR 1.1.3.6, then a bullet list of uses, and finally usage instructions. It is efficient and front-loaded with essential information. Minor redundancy could be trimmed, but overall effective.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool has no output schema, so the description should explain what the tool returns. It does not specify the output format (e.g., points value, exemption status). Given the complexity of ADR calculation, this is a notable gap. The description covers input usage well but lacks output details, making it incomplete for an agent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% with descriptions for each parameter. The description adds semantic value by explaining conditional usage: 'For single substances, provide un_number + quantity. For mixed loads, use the items array.' This clarifies the relationship between parameters beyond the schema definitions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Calculate ADR 1.1.3.6 exemption thresholds for mixed hazardous loads.' It uses a specific verb ('calculate') and resource ('exemption thresholds'), and the subsequent bullet list reinforces this. The tool is distinct from sibling tools like adr_lookup, which likely provide different functionality.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit use cases: 'Check if a load qualifies for the small load exemption,' 'Calculate total ADR points,' and 'Determine if full ADR compliance is required.' It also distinguishes between single and mixed loads. However, it does not mention when not to use this tool or point to alternative sibling tools for related tasks (e.g., adr_lq_eq_check).

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/SoapyRED/freightutils-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server