Skip to main content
Glama
europarcel
by europarcel

Get Customer Profile

getProfile

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

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

  • Tool handler function that registers the 'getProfile' MCP tool. It retrieves the API key from async context, calls client.getProfile(), formats the customer profile response (account info, wallet balance, notification settings, marketing preferences), and returns it as a formatted text response.
    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");
    }
  • Registration of the 'getProfile' tool via server.registerTool() with tool name 'getProfile', title 'Get Customer Profile', description, and empty inputSchema.
    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: {},
      },
  • API client method getProfile() that makes a GET request to /account/profile endpoint and returns a ProfileResponse.
    async getProfile(): Promise<ProfileResponse> {
      const response = await this.client.get<ProfileResponse>("/account/profile");
      return response.data;
    }
  • ProfileResponse type: contains a 'message' string and 'data' field of type CustomerProfile.
    export interface ProfileResponse {
      message: string;
      data: CustomerProfile;
    }
  • CustomerProfile type definition with fields: customer_id, name, email, billing_country, preferred_language, currency, awb_format, bank_iban, bank_holder, email_verified, phone, phone_verified, wallet_balance, wallet_currency, notification_settings, marketing_settings.
    export interface CustomerProfile {
      customer_id: number;
      name: string;
      email: string;
      billing_country: string;
      preferred_language: string;
      currency: string;
      awb_format: string;
      bank_iban: string | null;
      bank_holder: string | null;
      email_verified: boolean;
      phone: string | null;
      phone_verified: boolean;
      wallet_balance: number;
      wallet_currency: string;
      notification_settings: NotificationSettings;
      marketing_settings: MarketingSettings;
    }
Behavior3/5

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

With no annotations, the description carries the full burden. It correctly indicates a read operation without side effects but does not disclose potential errors, rate limits, or auth requirements beyond being authenticated.

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 sentence that efficiently conveys the tool's purpose and key details with no wasted words.

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 no output schema, the description explains that it returns 'complete profile information' and lists some fields. This is mostly sufficient for a simple retrieval, though it could mention the structure or note that all fields are included.

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, so the description cannot add meaning beyond the schema. Baseline is 4 since there are no parameters to explain, and the description correctly says it returns profile information.

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 ('retrieves') and the resource ('authenticated customer's complete profile information') with specific examples (wallet balance, notification preferences, account settings). It distinguishes itself from sibling tools like createOrder or getOrders, which are for different purposes.

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 for retrieving the current user's profile but does not provide explicit guidance on when to use it versus alternatives or when not to use it. No alternative tools are mentioned.

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