Skip to main content
Glama

purchase_phone_plan

Destructive

Purchase a PHONE-NUMBER eSIM — a plan with a real carrier phone number (voice + SMS + data). Deducts from your prepaid agent wallet and returns order details with activation info (ICCID, QR code, SM-DP+). The real phone number is assigned by the carrier when the eSIM registers on the network and appears in the device settings after activation. Use the packageCode from search_phone_plans. Plans whose search result says "designated-date activation" REQUIRE activationDate. 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_phone_plan"
  }
}

Input Schema

NameRequiredDescriptionDefault
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.
packageCodeYesPhone-plan package code (use search_phone_plans to find codes, e.g., change-plus-7days-1gb)
activationDateNoActivation date in YYYY-MM-DD — ONLY for plans marked "designated-date activation" in search results (e.g. the Australia phone plan), where it is REQUIRED and must be at least 2 and at most 60 days from today. Ask the user for their service start date. Omit for all other plans.

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 / activationDate
      Added value: +{
      +  "description": "Activation date in YYYY-MM-DD — ONLY for plans marked \"designated-date activation\" in search results (e.g. the Australia phone plan), where it is REQUIRED and must be at least 2 and at most 60 days from today. Ask the user for their service start date. Omit for all other plans.",
      +  "type": "string"
      +}
  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. Added

TDQS

A4.3/5.0
Behavior5/5

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

Adds substantial behavior beyond the annotations: funds are deducted from a prepaid agent wallet, the response carries order details plus activation data (ICCID, QR, SM-DP+), and the actual phone number is assigned later by the carrier at network registration. It also discloses the no-wallet path (nothing charged, checkout link returned) and that an invalid promo code rejects the order with no charge. The retry-with-same-requestId behavior is consistent with idempotentHint=false, since a new purchase with a fresh key still charges.

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-loads what is being bought and what it costs the agent, then layers the activation-date and wallet branching in subsequent sentences. Dense but each sentence carries operational value; minor overlap between the ICCID/QR return detail and the later note about when the number appears.

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?

For a destructive, money-moving purchase with no output schema, the description covers charging, the zero-charge checkout fallback, activation-data return, and conditional required parameters. It does not address failure/refund handling for a charged-but-unactivated order or how to check order state afterward, which is the main remaining 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 description coverage is 100%, so the schema already documents payWith, promoCode, requestId, packageCode and activationDate in detail. The description restates the activationDate rule and the wallet/checkout distinction that the schema already explains, adding little new parameter-level meaning. Baseline 3 is appropriate where the schema does the work.

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 with scope qualifiers: 'Purchase a PHONE-NUMBER eSIM — a plan with a real carrier phone number (voice + SMS + data).' The 'PHONE-NUMBER' emphasis and the voice+SMS+data qualifier let an agent distinguish this from a plain data eSIM purchase without opening a 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 concrete preconditions: obtain packageCode from search_phone_plans, and supply activationDate only for plans marked 'designated-date activation' in search results. It also explains the wallet-vs-no-wallet branching that determines whether money moves. It stops short of explicitly excluding a sibling (e.g. a data-only eSIM purchase) by name, which keeps it from a 5.

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