Skip to main content
Glama
europarcel
by europarcel

Get All Shipping Addresses

getShippingAddresses

Retrieve all shipping addresses and pickup locations for the authenticated customer. Returns complete list with coordinates and postal codes.

Instructions

Retrieves all shipping addresses (pickup locations) for the authenticated customer. Returns complete list with coordinates and postal codes.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler function that registers and implements the 'getShippingAddresses' MCP tool. It retrieves the API key from async context, creates an API client, fetches all shipping addresses via client.getShippingAddresses({all:true}), formats the response, and returns it as text content.
    export function registerGetShippingAddressesTool(server: McpServer): void {
      // Create API client instance
    
      // Register getShippingAddresses tool
      server.registerTool(
        "getShippingAddresses",
        {
          title: "Get All Shipping Addresses",
          description:
            "Retrieves all shipping addresses (pickup locations) for the authenticated customer. Returns complete list with coordinates and postal codes.",
          inputSchema: {},
        },
        async () => {
          // 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 {
            logger.info("Fetching all shipping addresses");
    
            const response = await client.getShippingAddresses({
              all: true,
            });
    
            logger.info(`Retrieved ${response.list.length} shipping addresses`);
    
            let formattedResponse = `Found ${response.meta.total} shipping address${response.meta.total !== 1 ? "es" : ""}:\n\n`;
    
            if (response.list.length === 0) {
              formattedResponse += "No shipping addresses found.";
            } else {
              response.list.forEach((address: ShippingAddress) => {
                formattedResponse += formatAddress(address, "Shipping") + "\n";
              });
            }
    
            return {
              content: [
                {
                  type: "text",
                  text: formattedResponse,
                },
              ],
            };
          } catch (error: any) {
            logger.error("Failed to fetch shipping addresses", error);
    
            return {
              content: [
                {
                  type: "text",
                  text: `Error fetching shipping addresses: ${error.message || "Unknown error"}`,
                },
              ],
            };
          }
        },
      );
    
      logger.info("getShippingAddresses tool registered successfully");
    }
  • Helper function formatAddress() that formats a shipping/delivery address into a human-readable string with details like type, contact, phone, email, location, street, zipcode, coordinates, and default status.
    function formatAddress(address: any, type: string): string {
      let details = `${type} Address #${address.id}:
    - Type: ${address.address_type}
    - Contact: ${address.contact}
    - Phone: ${address.phone}
    - Email: ${address.email}
    - Location: ${address.locality_name}, ${address.county_name} (${address.country_code})
    - Street: ${address.street_name || "N/A"} ${address.street_no}${address.street_details ? ", " + address.street_details : ""}`;
    
      if ((type === "Shipping" || type === "Delivery") && address.zipcode) {
        details += `
    - Zip Code: ${address.zipcode}`;
      }
    
      if ((type === "Shipping" || type === "Delivery") && address.coordinates) {
        details += `
    - Coordinates: ${address.coordinates.lat}, ${address.coordinates.lng}`;
      }
    
      details += `
    - Default: ${address.is_default ? "Yes" : "No"}
    `;
    
      return details;
    }
  • The API client method getShippingAddresses() that makes the actual HTTP GET request to /addresses/shipping with optional pagination params. Returns a PaginatedAddressResponse<ShippingAddress>.
    async getShippingAddresses(params?: {
      page?: number;
      per_page?: 15 | 50 | 100 | 200;
      all?: boolean;
    }): Promise<PaginatedAddressResponse<ShippingAddress>> {
      const response = await this.client.get<
        PaginatedAddressResponse<ShippingAddress>
      >("/addresses/shipping", {
        params,
      });
      return response.data;
    }
  • Type definition for ShippingAddress interface extending Address with zipcode, optional company, and optional coordinates (lat/lng).
    export interface ShippingAddress extends Address {
      zipcode: string;
      company?: string | null;
      coordinates?: {
        lat: number;
        lng: number;
      } | null;
    }
  • Registration entry point that imports and calls registerGetShippingAddressesTool() as part of registering all address tools on the MCP server.
    import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
    import { registerGetBillingAddressesTool } from "./getBillingAddresses.js";
    import { registerGetShippingAddressesTool } from "./getShippingAddresses.js";
    import { registerGetDeliveryAddressesTool } from "./getDeliveryAddresses.js";
    import { logger } from "../../utils/logger.js";
    
    export function registerAddressTools(server: McpServer): void {
      logger.info("Registering address tools...");
    
      // Register all address-related tools
      registerGetBillingAddressesTool(server);
      registerGetShippingAddressesTool(server);
      registerGetDeliveryAddressesTool(server);
    
      logger.info("All address tools registered successfully");
    }
    
    // Export individual registration functions if needed
    export { registerGetBillingAddressesTool } from "./getBillingAddresses.js";
    export { registerGetShippingAddressesTool } from "./getShippingAddresses.js";
    export { registerGetDeliveryAddressesTool } from "./getDeliveryAddresses.js";
Behavior2/5

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

No annotations are provided, and the description fails to disclose behavioral traits such as authentication requirements (beyond 'authenticated customer'), rate limits, data freshness, or whether the list is paginated. The description is too simplistic for a tool with no 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 concise (two sentences) and front-loaded with the core purpose. However, it could be more structured by adding usage context or behavioral notes.

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?

For a simple read operation with no parameters and no output schema, the description covers the basic purpose. However, it lacks guidance on when to use, behavioral transparency, and interaction with sibling tools, making it only minimally complete.

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?

The input schema has zero parameters, and schema description coverage is 100%. According to guidelines, 0 params yields a baseline of 4. The description adds no parameter info, which is acceptable.

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 title and description clearly state the tool retrieves all shipping addresses (pickup locations) for the authenticated customer, returning a complete list with coordinates and postal codes. This distinguishes it from sibling address tools like getBillingAddresses and getDeliveryAddresses.

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?

The description provides no explicit guidance on when to use this tool versus alternatives. Given multiple address-related sibling tools (getBillingAddresses, getDeliveryAddresses), the description lacks differentiation or usage context.

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