Skip to main content
Glama
europarcel
by europarcel

Track Multiple AWBs by Carrier

trackAwbsByCarrier

Track multiple AWB numbers from a specific carrier by providing the carrier ID and up to 200 AWB numbers. Supports language selection for responses.

Instructions

Track multiple AWB numbers from a specific carrier. Parameters: carrier_id (required - accepts numbers like 3 and strings like '3'), awb_list (array, max 200, required), language (optional, default 'ro')

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
carrier_idYesCarrier ID: 1=Cargus, 2=DPD, 3=FAN Courier, 4=GLS, 6=Sameday, 16=Bookurier
awb_listYesArray of AWB numbers to track (1-200)
languageNoLanguage for tracking responses: ro (default), de, en, fr, hu, bg

Implementation Reference

  • Registration and handler for the trackAwbsByCarrier tool. Defines the input schema (carrier_id, awb_list, language), calls the API client, and formats the response.
    export function registerTrackAwbsByCarrierTool(server: McpServer): void {
      // Create API client instance
    
      // Register trackAwbsByCarrier tool
      server.registerTool(
        "trackAwbsByCarrier",
        {
          title: "Track Multiple AWBs by Carrier",
          description:
            "Track multiple AWB numbers from a specific carrier. Parameters: carrier_id (required - accepts numbers like 3 and strings like '3'), awb_list (array, max 200, required), language (optional, default 'ro')",
          inputSchema: {
            carrier_id: z
              .union([
                z.literal(1),
                z.literal(2),
                z.literal(3),
                z.literal(4),
                z.literal(6),
                z.literal(16),
              ])
              .describe(
                "Carrier ID: 1=Cargus, 2=DPD, 3=FAN Courier, 4=GLS, 6=Sameday, 16=Bookurier",
              ),
            awb_list: z
              .array(z.string())
              .min(1)
              .max(200)
              .describe("Array of AWB numbers to track (1-200)"),
            language: z
              .enum(["ro", "de", "en", "fr", "hu", "bg"])
              .optional()
              .describe(
                "Language for tracking responses: ro (default), de, en, fr, hu, bg",
              ),
          },
        },
        async (args: any) => {
          // Get API key from async context
          const apiKey = apiKeyStorage.getStore();
    
          if (!apiKey) {
            return {
              content: [
                {
                  type: "text",
                  text: "Error: X-API-KEY header is required",
                },
              ],
            };
          }
    
          // Create API client with customer's API key
          const client = new EuroparcelApiClient(apiKey);
    
          try {
            const carrierId = args.carrier_id;
            const language = args.language || "ro";
    
            logger.info("Tracking AWBs by carrier", {
              carrier_id: carrierId,
              awb_count: args.awb_list.length,
              language,
            });
    
            const trackingInfo = await client.trackAwbsByCarrier(
              carrierId,
              args.awb_list,
              language,
            );
    
            logger.info(`Retrieved tracking info for ${trackingInfo.length} AWBs`);
    
            let formattedResponse = `📍 Tracking Results for Carrier #${carrierId} (${trackingInfo.length} AWBs):\n\n`;
    
            if (trackingInfo.length === 0) {
              formattedResponse +=
                "No tracking information found for the provided AWBs.";
            } else {
              trackingInfo.forEach((info) => {
                formattedResponse += `📦 AWB: ${info.awb}\n`;
                if (info.order_id) {
                  formattedResponse += `   Order ID: ${info.order_id}\n`;
                }
                formattedResponse += `   Carrier: ${info.carrier}\n`;
                formattedResponse += `   Status: ${info.current_status} (ID: ${info.current_status_id})\n`;
                formattedResponse += `   Description: ${info.current_status_description}\n`;
                formattedResponse += `   Final Status: ${info.is_current_status_final ? "Yes" : "No"}\n`;
                if (info.track_url) {
                  formattedResponse += `   Track URL: ${info.track_url}\n`;
                }
                if (info.reference) {
                  formattedResponse += `   Reference: ${info.reference}\n`;
                }
                formattedResponse += "\n";
              });
            }
    
            return {
              content: [
                {
                  type: "text",
                  text: formattedResponse,
                },
              ],
            };
          } catch (error: any) {
            logger.error("Failed to track AWBs", error);
    
            return {
              content: [
                {
                  type: "text",
                  text: `Error tracking AWBs: ${error.message || "Unknown error"}`,
                },
              ],
            };
          }
        },
      );
    
      logger.info("trackAwbsByCarrier tool registered successfully");
    }
  • Input schema using Zod for the trackAwbsByCarrier tool: carrier_id (union of literals 1-16), awb_list (array of strings, 1-200), language (optional enum).
    inputSchema: {
      carrier_id: z
        .union([
          z.literal(1),
          z.literal(2),
          z.literal(3),
          z.literal(4),
          z.literal(6),
          z.literal(16),
        ])
        .describe(
          "Carrier ID: 1=Cargus, 2=DPD, 3=FAN Courier, 4=GLS, 6=Sameday, 16=Bookurier",
        ),
      awb_list: z
        .array(z.string())
        .min(1)
        .max(200)
        .describe("Array of AWB numbers to track (1-200)"),
      language: z
        .enum(["ro", "de", "en", "fr", "hu", "bg"])
        .optional()
        .describe(
          "Language for tracking responses: ro (default), de, en, fr, hu, bg",
        ),
    },
  • API client helper method that POSTs to /orders/track-by-awb with carrier_id, awb_list, and language parameters.
    async trackAwbsByCarrier(
      carrierId: number,
      awbList: string[],
      language?: string,
    ): Promise<AwbTrackingInfo[]> {
      const response = await this.client.post<AwbTrackingInfo[]>(
        "/orders/track-by-awb",
        {
          carrier_id: carrierId,
          awb_list: awbList,
          language: language || "ro",
        },
      );
      return response.data;
    }
  • Type definition for AwbTrackingInfo, the response shape returned by trackAwbsByCarrier.
    export interface AwbTrackingInfo {
      order_id?: number;
      carrier_id: number;
      carrier: string;
      awb: string;
      track_url: string;
      current_status: string;
      current_status_id: number;
      current_status_description: string;
      is_current_status_final: boolean;
      reference: string;
      history: OrderHistoryItem[];
    }
  • Registration of trackAwbsByCarrier in the orders index module. Imports and invokes registerTrackAwbsByCarrierTool(server) as part of registerOrderTools().
    import { registerTrackAwbsByCarrierTool } from "./trackAwbsByCarrier.js";
    import { registerGenerateLabelLinkTool } from "./generateLabelLink.js";
    import { registerTrackOrdersByIdsTool } from "./trackOrdersByIds.js";
    import { registerPricingTools } from "./getPricing.js";
    import { registerCreateOrderTool } from "./createOrder.js";
    import { logger } from "../../utils/logger.js";
    
    export function registerOrderTools(server: McpServer): void {
      logger.info("Registering order tools...");
    
      // Register all order-related tools
      registerGetOrdersTool(server);
      registerGetOrderByIdTool(server);
      registerCancelOrderTool(server);
      registerTrackAwbsByCarrierTool(server);
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It adds behavioral details beyond the schema: carrier_id accepts both numbers and strings like '3', and language defaults to 'ro'. However, it does not disclose failure modes, rate limits, authentication needs, or return value behavior.

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

Conciseness5/5

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

The description is very concise: two sentences covering the purpose and parameter details. No redundant phrases or unnecessary information. Every word adds value, making it easy to scan.

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

Completeness4/5

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

For a simple tracking tool with 3 parameters and no output schema, the description covers all parameter semantics and provides default values. It lacks details on return structure or error handling, but given the tool's straightforward nature, it is mostly complete.

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

Parameters3/5

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

Schema description coverage is 100% (all parameters have descriptions in the schema). The description adds minor nuance: carrier_id accepts both number and string types, and language has a default. Since coverage is high, baseline is 3, and the added value is marginal, so score remains 3.

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 action ('Track multiple AWB numbers from a specific carrier'), using a specific verb and resource. It distinguishes itself from sibling tools like trackOrdersByIds (which tracks orders) and other carrier-related tools. The purpose is unambiguous and matches the title.

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

Usage Guidelines3/5

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

The description implies usage context by specifying 'from a specific carrier' and listing required parameters, but it does not explicitly mention when to use this tool versus alternatives (e.g., trackOrdersByIds for orders). No guidance on when not to use it or prerequisites is provided.

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/europarcel/mcp-docker'

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