Skip to main content
Glama
europarcel
by europarcel

Track Multiple Orders

trackOrdersByIds

Track multiple orders simultaneously by submitting their order IDs. Retrieve status updates in your preferred language.

Instructions

Track multiple orders by their order IDs. Parameters: order_ids (array of order IDs, required), language (optional, default 'ro')

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
order_idsYesArray of order IDs to track (positive integers, minimum 1)
languageNoLanguage for tracking responses: ro (default), de, en, fr, hu, bg

Implementation Reference

  • Registers the trackOrdersByIds tool with the MCP server, providing the handler that validates API key, calls the API client, formats tracking info for multiple orders, and handles errors.
    export function registerTrackOrdersByIdsTool(server: McpServer): void {
      // Create API client instance
    
      // Register trackOrdersByIds tool
      server.registerTool(
        "trackOrdersByIds",
        {
          title: "Track Multiple Orders",
          description:
            "Track multiple orders by their order IDs. Parameters: order_ids (array of order IDs, required), language (optional, default 'ro')",
          inputSchema: {
            order_ids: z
              .array(z.number().int().min(1))
              .min(1)
              .describe(
                "Array of order IDs to track (positive integers, minimum 1)",
              ),
            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 language = args.language || "ro";
    
            logger.info("Tracking orders by IDs", {
              order_count: args.order_ids.length,
              language,
            });
    
            const trackingInfo = await client.trackOrdersByIds(
              args.order_ids,
              language,
            );
    
            logger.info(
              `Retrieved tracking info for ${trackingInfo.length} orders`,
            );
    
            let formattedResponse = `📍 Tracking Results for ${trackingInfo.length} Orders:\n\n`;
    
            if (trackingInfo.length === 0) {
              formattedResponse +=
                "No tracking information found for the provided order IDs.";
            } else {
              trackingInfo.forEach((info) => {
                formattedResponse += `📦 Order #${info.order_id} - AWB: ${info.awb}\n`;
                formattedResponse += `   Carrier: ${info.carrier} (ID: ${info.carrier_id})\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`;
                }
    
                if (info.history && info.history.length > 0) {
                  formattedResponse += `   Latest Event: ${new Date(info.history[0].timestamp).toLocaleString()} - ${info.history[0].status}\n`;
                }
    
                formattedResponse += "\n";
              });
            }
    
            return {
              content: [
                {
                  type: "text",
                  text: formattedResponse,
                },
              ],
            };
          } catch (error: any) {
            logger.error("Failed to track orders", error);
    
            return {
              content: [
                {
                  type: "text",
                  text: `Error tracking orders: ${error.message || "Unknown error"}`,
                },
              ],
            };
          }
        },
      );
    
      logger.info("trackOrdersByIds tool registered successfully");
    }
  • Type definition for the tracking information returned by trackOrdersByIds, including order details, carrier, AWB, status, tracking URL, and history.
    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[];
    }
  • Input schema for the trackOrdersByIds tool: requires an array of order IDs and optionally a language code.
    inputSchema: {
      order_ids: z
        .array(z.number().int().min(1))
        .min(1)
        .describe(
          "Array of order IDs to track (positive integers, minimum 1)",
        ),
      language: z
        .enum(["ro", "de", "en", "fr", "hu", "bg"])
        .optional()
        .describe(
          "Language for tracking responses: ro (default), de, en, fr, hu, bg",
        ),
    },
  • API client method that sends a POST request to /orders/track-by-order with the order IDs and language, returning an array of AwbTrackingInfo objects.
    async trackOrdersByIds(
      orderIds: number[],
      language?: string,
    ): Promise<AwbTrackingInfo[]> {
      const response = await this.client.post<AwbTrackingInfo[]>(
        "/orders/track-by-order",
        {
          order_ids: orderIds,
          language: language || "ro",
        },
      );
      return response.data;
    }
  • Registration call in the order tools aggregator, which registers all order-related tools including trackOrdersByIds.
    registerTrackOrdersByIdsTool(server);
Behavior2/5

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

No annotations provided, so description bears full burden. It omits behavioral traits like read-only nature, side effects, auth requirements, or response format. For a tracking tool, it should disclose it is likely read-only.

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?

Two sentences, zero waste. First sentence states purpose, second lists parameters. Front-loaded and efficient.

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

Completeness2/5

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

No output schema, yet description does not mention return values (e.g., tracking status, location). Also lacks context on ordering or relationships with sibling tools. Incomplete for a tracking tool.

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 coverage is 100% and already fully documents both parameters. The description adds minimal value by restating 'required' and 'optional' but does not exceed schema detail. Baseline 3 applies.

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 verb 'track' and the resource 'multiple orders' with the method 'by their order IDs'. It distinguishes from siblings like getOrderById (single order) and getOrders (list all).

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

Usage Guidelines2/5

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

No guidance on when to use this tool versus alternatives. The description does not mention context, prerequisites, or when not to use it.

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