Skip to main content
Glama
europarcel
by europarcel

Get Customer Profile

getProfile

Retrieve authenticated customer profile details including wallet balance, notification preferences, and account settings for Europarcel shipping operations.

Instructions

Retrieves the authenticated customer's complete profile information including wallet balance, notification preferences, and account settings

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The core handler logic for the getProfile tool. Retrieves the customer's API key, instantiates the API client, fetches the profile data, formats it comprehensively, and returns a structured text response or error.
        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("Executing getProfile tool");
    
            // Call the API
            const profileData = await client.getProfile();
    
            // Type assertion to access actual API response properties
            const notifications = profileData.data.notification_settings as any;
    
            // Format the response for the AI
            const formattedResponse = `
    Customer Profile Retrieved Successfully:
    
    Account Information:
    - Customer ID: ${profileData.data.customer_id}
    - Name: ${profileData.data.name}
    - Email: ${profileData.data.email} ${profileData.data.email_verified ? "✓ Verified" : "✗ Not verified"}
    - Phone: ${profileData.data.phone || "Not provided"} ${profileData.data.phone_verified ? "✓ Verified" : "✗ Not verified"}
    - Country: ${profileData.data.billing_country}
    - Language: ${profileData.data.preferred_language}
    - Currency: ${profileData.data.currency}
    
    Wallet Information:
    - Balance: ${profileData.data.wallet_balance} ${profileData.data.wallet_currency}
    
    Preferences:
    - AWB Format: ${profileData.data.awb_format}
    - Bank IBAN: ${profileData.data.bank_iban || "Not configured"}
    - Bank Holder: ${profileData.data.bank_holder || "Not configured"}
    
    Notification Settings:
    - Bordero Notifications: ${notifications.receive_bordero ? "Enabled" : "Disabled"}
      Email: ${notifications.email_bordero}
    - Prevention Email: ${notifications.prevention_email_notification ? "Enabled" : "Disabled"}
      Email: ${notifications.email_prevention}
    - Non-Pickup Alerts: ${notifications.non_pickup_notification ? "Enabled" : "Disabled"}
      Email: ${notifications.email_non_pickup}
    - Recipient Pickup Confirmation: ${notifications.recipient_pickup_confirmation_email ? "Enabled" : "Disabled"}
    - Delivery Confirmation: ${notifications.delivery_confirmation_email ? "Enabled" : "Disabled"}
      Email: ${notifications.email_delivery_confirmation}
    - Wallet Transactions: ${notifications.wallet_transaction_email ? "Enabled" : "Disabled"}
      Email: ${notifications.email_wallet_transaction}
    - Placed Orders: ${notifications.placed_order_email ? "Enabled" : "Disabled"}
      Email: ${notifications.email_placed_order}
    - Phone Delivery Notifications: ${notifications.phone_delivery_notification || "Not configured"}
    
    Marketing Preferences:
    - Email Notifications: ${profileData.data.marketing_settings.email_notifications ? "Enabled" : "Disabled"}
    - SMS Notifications: ${profileData.data.marketing_settings.sms_notifications ? "Enabled" : "Disabled"}
    `;
    
            logger.info("getProfile tool executed successfully");
    
            return {
              content: [
                {
                  type: "text",
                  text: formattedResponse,
                },
              ],
            };
          } catch (error) {
            logger.error("Error in getProfile tool", error);
    
            return {
              content: [
                {
                  type: "text",
                  text: `Failed to retrieve profile: ${error instanceof Error ? error.message : "Unknown error"}`,
                },
              ],
              isError: true,
            };
          }
        },
  • Registers the getProfile tool with the MCP server, specifying the tool name, schema (title, description, empty inputSchema), and handler function.
    export function registerGetProfileTool(server: McpServer): void {
      // Register getProfile tool
      server.registerTool(
        "getProfile",
        {
          title: "Get Customer Profile",
          description:
            "Retrieves the authenticated customer's complete profile information including wallet balance, notification preferences, and account settings",
          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("Executing getProfile tool");
    
            // Call the API
            const profileData = await client.getProfile();
    
            // Type assertion to access actual API response properties
            const notifications = profileData.data.notification_settings as any;
    
            // Format the response for the AI
            const formattedResponse = `
    Customer Profile Retrieved Successfully:
    
    Account Information:
    - Customer ID: ${profileData.data.customer_id}
    - Name: ${profileData.data.name}
    - Email: ${profileData.data.email} ${profileData.data.email_verified ? "✓ Verified" : "✗ Not verified"}
    - Phone: ${profileData.data.phone || "Not provided"} ${profileData.data.phone_verified ? "✓ Verified" : "✗ Not verified"}
    - Country: ${profileData.data.billing_country}
    - Language: ${profileData.data.preferred_language}
    - Currency: ${profileData.data.currency}
    
    Wallet Information:
    - Balance: ${profileData.data.wallet_balance} ${profileData.data.wallet_currency}
    
    Preferences:
    - AWB Format: ${profileData.data.awb_format}
    - Bank IBAN: ${profileData.data.bank_iban || "Not configured"}
    - Bank Holder: ${profileData.data.bank_holder || "Not configured"}
    
    Notification Settings:
    - Bordero Notifications: ${notifications.receive_bordero ? "Enabled" : "Disabled"}
      Email: ${notifications.email_bordero}
    - Prevention Email: ${notifications.prevention_email_notification ? "Enabled" : "Disabled"}
      Email: ${notifications.email_prevention}
    - Non-Pickup Alerts: ${notifications.non_pickup_notification ? "Enabled" : "Disabled"}
      Email: ${notifications.email_non_pickup}
    - Recipient Pickup Confirmation: ${notifications.recipient_pickup_confirmation_email ? "Enabled" : "Disabled"}
    - Delivery Confirmation: ${notifications.delivery_confirmation_email ? "Enabled" : "Disabled"}
      Email: ${notifications.email_delivery_confirmation}
    - Wallet Transactions: ${notifications.wallet_transaction_email ? "Enabled" : "Disabled"}
      Email: ${notifications.email_wallet_transaction}
    - Placed Orders: ${notifications.placed_order_email ? "Enabled" : "Disabled"}
      Email: ${notifications.email_placed_order}
    - Phone Delivery Notifications: ${notifications.phone_delivery_notification || "Not configured"}
    
    Marketing Preferences:
    - Email Notifications: ${profileData.data.marketing_settings.email_notifications ? "Enabled" : "Disabled"}
    - SMS Notifications: ${profileData.data.marketing_settings.sms_notifications ? "Enabled" : "Disabled"}
    `;
    
            logger.info("getProfile tool executed successfully");
    
            return {
              content: [
                {
                  type: "text",
                  text: formattedResponse,
                },
              ],
            };
          } catch (error) {
            logger.error("Error in getProfile tool", error);
    
            return {
              content: [
                {
                  type: "text",
                  text: `Failed to retrieve profile: ${error instanceof Error ? error.message : "Unknown error"}`,
                },
              ],
              isError: true,
            };
          }
        },
      );
    
      logger.info("getProfile tool registered successfully");
    }
  • The input/output schema definition for the getProfile tool, with title, description, and empty input schema.
    {
      title: "Get Customer Profile",
      description:
        "Retrieves the authenticated customer's complete profile information including wallet balance, notification preferences, and account settings",
      inputSchema: {},
    },
  • Helper method in EuroparcelApiClient that makes the actual API call to retrieve the customer profile from /account/profile endpoint.
    async getProfile(): Promise<ProfileResponse> {
      const response = await this.client.get<ProfileResponse>("/account/profile");
      return response.data;
    }
  • Top-level registration function for account tools, which invokes the specific getProfile tool registration.
    export function registerAccountTools(server: McpServer): void {
      logger.info("Registering account tools...");
    
      // Register all account-related tools
      registerGetProfileTool(server);
    
      logger.info("All account tools registered successfully");
    }
Behavior3/5

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

With no annotations provided, the description carries full burden. It discloses that it retrieves data (read-only behavior) and specifies the types of information included (wallet balance, preferences, settings), which is useful context. However, it doesn't mention potential limitations like authentication requirements, rate limits, or error conditions, leaving gaps for a tool with no annotation support.

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 a single, well-structured sentence that efficiently communicates the tool's purpose, target, and key data inclusions without any redundant or extraneous information. It's front-loaded with the core action and resource.

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?

Given the tool's simplicity (0 parameters, no output schema, no annotations), the description is reasonably complete. It explains what the tool does and what information it returns. However, without an output schema, it could benefit from more detail on the return format or structure, but the listed inclusions (wallet balance, etc.) provide adequate guidance for basic use.

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 0 parameters with 100% coverage, so no parameter documentation is needed. The description appropriately doesn't discuss parameters, focusing instead on the tool's purpose and output scope. This meets the baseline for tools with no parameters.

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 specific action ('retrieves'), target resource ('authenticated customer's complete profile information'), and scope ('including wallet balance, notification preferences, and account settings'). It distinguishes this tool from siblings like getOrders or getBillingAddresses by focusing on the customer's own profile rather than transactional data.

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 through 'authenticated customer's'—suggesting it's for the current user's profile—but doesn't explicitly state when to use this versus alternatives like getOrderById for order details or getBillingAddresses for address info. No explicit exclusions or named alternatives are 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'

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