Skip to main content
Glama

purchase_esim

Destructive

Purchase a DATA eSIM. Deducts from your prepaid agent wallet and returns order details with activation info (ICCID, QR code, SM-DP+). Use the packageCode from search_esim_packages. For a daily-reset "Unlimited" plan, also pass days (the number of days to buy). For phone-number eSIMs use purchase_phone_plan instead. With a connected wallet it charges the wallet; with NO wallet it charges nothing and returns a checkout link for this exact plan that the user pays on pikasim.com.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "packageCode": "<packageCode>"
    },
    "name": "purchase_esim"
  }
}

Input Schema

NameRequiredDescriptionDefault
daysNoONLY for daily-reset "Unlimited" plans (get_package_details shows "Type: Daily unlimited"): the number of days to purchase. Valid values: 3, 5, 7, 10, 15, 30. Required for those plans, and the total charged is the per-day price times this many days (minus a duration discount). Omit for fixed-data plans.
payWithNoOnly matters when a wallet is connected. "wallet" (default) charges the wallet. "checkout" charges nothing and returns a checkout link for this exact plan, for a user who wants to pay by card or crypto themselves instead of from the wallet.
promoCodeNoOptional promo/discount code. Validated server-side; an invalid code rejects the order with the reason (nothing is charged). Only pass a code the user explicitly provided.
requestIdNoIdempotency key: generate a fresh UUID for each NEW purchase, and reuse the SAME value when retrying after a timeout or transport error — an identical retry returns the original order instead of charging again.
packageCodeYesThe data-eSIM package code shown in [brackets] by search_esim_packages or get_package_details (e.g. P6ZMSDS1G). Phone-plan codes are not valid here; use purchase_phone_plan for those.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / payWith
      Added value: +{
      +  "description": "Only matters when a wallet is connected. \"wallet\" (default) charges the wallet. \"checkout\" charges nothing and returns a checkout link for this exact plan, for a user who wants to pay by card or crypto themselves instead of from the wallet.",
      +  "enum": [
      +    "wallet",
      +    "checkout"
      +  ],
      +  "type": "string"
      +}
  2. Changed1 schema field changed
    • addedInput schema / properties / promoCode
      Added value: +{
      +  "description": "Optional promo/discount code. Validated server-side; an invalid code rejects the order with the reason (nothing is charged). Only pass a code the user explicitly provided.",
      +  "type": "string"
      +}
  3. Changed1 schema field changed
    • addedInput schema / properties / days
      Added value: +{
      +  "description": "ONLY for daily-reset \"Unlimited\" plans (get_package_details shows \"Type: Daily unlimited\"): the number of days to purchase. Valid values: 3, 5, 7, 10, 15, 30. Required for those plans, and the total charged is the per-day price times this many days (minus a duration discount). Omit for fixed-data plans.",
      +  "maximum": 9007199254740991,
      +  "minimum": -9007199254740991,
      +  "type": "integer"
      +}
  4. Changed1 schema field changed
    • addedInput schema / properties / requestId
      Added value: +{
      +  "description": "Idempotency key: generate a fresh UUID for each NEW purchase, and reuse the SAME value when retrying after a timeout or transport error — an identical retry returns the original order instead of charging again.",
      +  "type": "string"
      +}
  5. Changed1 schema field changed
    • changedInput schema / properties / packageCode / description
      Previous value: -"Data eSIM package code (use search_esim_packages to find codes)"New value: +"The data-eSIM package code shown in [brackets] by search_esim_packages or get_package_details (e.g. P6ZMSDS1G). Phone-plan codes are not valid here; use purchase_phone_plan for those."
  6. Changed1 schema field changed
    • changedInput schema / properties / packageCode / description
      Previous value: -"Package code to purchase (use search_esim_packages to find codes)"New value: +"Data eSIM package code (use search_esim_packages to find codes)"
  7. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Annotations only declare the mutation/safety profile (destructive, open-world, non-idempotent); the description adds the economically critical behavior: funds are deducted from the prepaid wallet, the no-wallet path charges nothing and returns a checkout link, and the success response carries ICCID, QR code and SM-DP+ data. That is meaningful context an agent could not infer from the 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?

Front-loaded with purpose and effect, then conditional branches, then the sibling redirect. Dense but nearly every clause carries information; the parenthetical activation details and the days explanation are somewhat redundant with the schema.

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

Completeness5/5

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

For a money-moving mutation with five parameters and no output schema, the description covers charging semantics, the alternate checkout flow, required identifiers, and the return payload shape. Remaining gaps (insufficient-balance errors, refunds) are modest relative to what is disclosed.

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?

Schema coverage is 100%, so the schema already explains days, payWith, promoCode, requestId and packageCode in detail — the description largely restates the days rule. It does add workflow value by tying packageCode to search_esim_packages and by summarizing the days requirement, hence slightly above the baseline of 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 leads with a specific verb+resource ("Purchase a DATA eSIM") and immediately scopes it against the sibling: phone-number eSIMs go to purchase_phone_plan. The agent can distinguish this from purchase_phone_plan and topup_esim without opening any schema.

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

Usage Guidelines5/5

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

It states where packageCode comes from (search_esim_packages), when to pass days (only for daily-reset Unlimited plans), and names the explicit alternative for phone plans. When-not guidance and prerequisites are both present.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources