Skip to main content
Glama

Buy an eSIM

purchase_esim
Destructive

Buy an eSIM data plan with immediate balance charge; non-cancellable. Requires pre-approved max price; if price rises, no charge and new price returned. Returns eSIM ID with install details.

Instructions

Buy an eSIM data plan, charged to your balance immediately. It cannot be cancelled through this server once issued. Requires max_price_cents: the price from search_esim_plans that you showed the user and they approved; if the price is now higher, nothing is charged and the new price comes back to re-confirm. Returns the esim_ id with install details (LPA string, SM-DP+ address, activation code); if it is still processing, poll get_esim_status. Use get_esim_qr for the QR image.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
plan_idYesprod_... id from search_esim_plans
max_price_centsYesThe price you showed the user and they approved, in US cents (e.g. 250 = $2.50). Nothing is charged if the current price is higher; the new price comes back so you can ask the user again.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
esimYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv1.2.1
    • addedInput schema / properties / max_price_cents
      Added value: +{
      +  "description": "The price you showed the user and they approved, in US cents (e.g. 250 = $2.50). Nothing is charged if the current price is higher; the new price comes back so you can ask the user again.",
      +  "exclusiveMinimum": 0,
      +  "maximum": 1000000,
      +  "type": "integer"
      +}
    • changedInput schema / required
      Previous value: -[
      -  "plan_id"
      -]New value: +[
      +  "plan_id",
      +  "max_price_cents"
      +]
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "http://json-schema.org/draft-07/schema#",
      +  "additionalProperties": {},
      +  "properties": {
      +    "esim": {
      +      "additionalProperties": {},
      +      "properties": {
      +        "activation_code": {
      +          "type": [
      +            "string",
      +            "null"
      +          ]
      +        },
      +        "charged_price_cents": {
      +          "maximum": 9007199254740991,
      +          "minimum": -9007199254740991,
      +          "type": "integer"
      +        },
      +        "completed_at": {
      +          "type": [
      +            "string",
      +            "null"
      +          ]
      +        },
      +        "countries": {
      +          "items": {
      +            "type": "string"
      +          },
      +          "type": "array"
      +        },
      +        "created_at": {
      +          "type": "string"
      +        },
      +        "currency": {
      +          "const": "USD",
      +          "type": "string"
      +        },
      +        "data_limit_gb": {
      +          "type": [
      +            "number",
      +            "null"
      +          ]
      +        },
      +        "data_unlimited": {
      +          "type": "boolean"
      +        },
      +        "expires_at": {
      +          "type": [
      +            "string",
      +            "null"
      +          ]
      +        },
      +        "iccid": {
      +          "type": [
      +            "string",
      +            "null"
      +          ]
      +        },
      +        "id": {
      +          "type": "string"
      +        },
      +        "is_topup": {
      +          "type": "boolean"
      +        },
      +        "parent_order_id": {
      +          "type": [
      +            "string",
      +            "null"
      +          ]
      +        },
      +        "product_id": {
      +          "type": [
      +            "string",
      +            "null"
      +          ]
      +        },
      +        "qr_code_url": {
      +          "type": [
      +            "string",
      +            "null"
      +          ]
      +        },
      +        "routing_location": {
      +          "type": [
      +            "string",
      +            "null"
      +          ]
      +        },
      +        "smdp_address": {
      +          "type": [
      +            "string",
      +            "null"
      +          ]
      +        },
      +        "status": {
      +          "enum": [
      +            "processing",
      +            "completed",
      +            "cancelled",
      +            "refunded",
      +            "expired"
      +          ],
      +          "type": "string"
      +        },
      +        "validity_days": {
      +          "maximum": 9007199254740991,
      +          "minimum": -9007199254740991,
      +          "type": "integer"
      +        }
      +      },
      +      "required": [
      +        "id",
      +        "status",
      +        "product_id",
      +        "is_topup",
      +        "parent_order_id",
      +        "iccid",
      +        "activation_code",
      +        "qr_code_url",
      +        "smdp_address",
      +        "data_limit_gb",
      +        "data_unlimited",
      +        "validity_days",
      +        "countries",
      +        "routing_location",
      +        "charged_price_cents",
      +        "currency",
      +        "created_at",
      +        "completed_at",
      +        "expires_at"
      +      ],
      +      "type": "object"
      +    }
      +  },
      +  "required": [
      +    "esim"
      +  ],
      +  "type": "object"
      +}
  2. Changed2 schema fields changedv1.1.8
    • changedInput schema / properties / plan_id / description
      Previous value: -"prod_xxx from search_esim_plans"New value: +"prod_... id from search_esim_plans"
    • addedInput schema / properties / plan_id / pattern
      Added value: +"^(?:prod_[A-Za-z0-9_-]{1,64})$"
  3. First observedv1.1.3

TDQS

A4.9/5.0
Behavior5/5

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

Annotations flag a destructive, non-idempotent, open-world write, and the description adds rich context beyond them: immediate charge, no cancellation via this server, and the price-protection behavior (nothing charged if the price rose, new price returned to re-confirm). This is exactly the behavioral detail an agent needs before a purchase.

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?

Front-loaded with the action and its cost implication, then prerequisites, then result handling. Every clause carries operational weight with no filler.

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 destructive purchase tool, the description covers charging, irreversibility, price-change handling, return value (esim_ id with install details), and two follow-up paths. Even though an output schema exists, nothing needed to call it correctly is missing.

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 baseline is 3, but the description reinforces that max_price_cents is the approved price from search_esim_plans tied to the user's confirmation, adding workflow meaning beyond the raw schema text.

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?

States a specific verb+resource ('Buy an eSIM data plan') and immediately scopes the side effect ('charged to your balance immediately'). Clearly distinguishable from siblings like search_esim_plans, topup_esim, and get_esim_qr.

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?

Explicitly names prerequisites and alternatives: max_price_cents must come from search_esim_plans and be user-approved, poll get_esim_status while processing, and use get_esim_qr for the QR image. When-to-use and which-sibling-to-use are both covered.

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