Skip to main content
Glama

Buy an eSIM

purchase_esim
Destructive

Buy an eSIM data plan with a user-approved max price and immediate balance charge; no cancellation after issue. Returns eSIM ID and install details, or a new price if higher.

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. get_esim_status with include_qr=true returns the QR image.

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": {
      "plan_id": "<plan_id>",
      "max_price_cents": "<max_price_cents>"
    },
    "name": "purchase_esim"
  }
}

Input 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

NameRequiredDescriptionDefault
esimYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv2.0.0
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • changedOutput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
  2. 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"
      +}
  3. 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})$"
  4. First observedv1.1.3

TDQS

A4.5/5.0
Behavior5/5

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

Annotations only flag destructive/non-idempotent/open-world; the description adds the material facts an agent needs: the charge is immediate, the purchase is irreversible through this server, and a stale max_price_cents aborts the charge and returns the new price for re-confirmation. That is genuine behavioral context beyond the structured fields.

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-loads the two risk facts (immediate charge, no cancellation) before mechanics, and each following sentence covers a distinct concern: price guard, return payload, and polling fallback. 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 two-parameter destructive purchase, the description covers cost risk, irreversibility, price-change handling, the returned esim_ id with install details, and the next step when processing. An output schema exists, so the return-value summary is bonus rather than a gap.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% and both parameter descriptions already state the prod_ id source and the approved-price semantics, so the description largely restates the schema. The added value is only the framing that the price must be one the user was shown and approved, which the schema also conveys.

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 and resource ("Buy an eSIM data plan") and immediately scopes it with the charging model and non-cancellability, which separates it from topup_esim and search_esim_plans among the siblings. An agent can identify the operation without opening the schema.

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

Usage Guidelines4/5

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

Gives a clear precondition (plan_id and the approved price must come from search_esim_plans) and a follow-up path (poll get_esim_status if processing). It never explicitly rules out topup_esim for adding data to an existing eSIM, so the alternative-selection guidance is incomplete rather than exhaustive.

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