Skip to main content
Glama

purchase_credits

Idempotent

Purchase organization-bound prepaid service credits in USD cents. Requires billing scope and an idempotency key. A live 402 response returns an MPP card-payment challenge; retry the same purchase/key with payment_authorization separately from the account Bearer token. Authenticated provider confirmation credits the balance exactly once. Sandbox purchases are simulated. Cards are supported; stablecoins are not enabled.

Input Schema

NameRequiredDescriptionDefault
automaticNoUse a previously recorded bounded funding mandate; false for an ordinary one-time purchase.
amount_centsYesPurchase amount in USD cents, from 50 ($0.50) to 100000 ($1000); live account spending and launch limits also apply.
idempotency_keyYesCaller-generated key, 8–128 letters, digits, underscores, dots, colons or hyphens. Reuse for retries of the same purchase or operation. Different input with the same organization-bound key returns a conflict.
payment_authorizationNoMPP card authorization responding to this purchase's payment_challenge. Omit on the first call; never place the account Bearer token here.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed8 schema fields changed
    • addedInput schema / properties / amount_cents / description
      Added value: +"Purchase amount in USD cents, from 50 ($0.50) to 100000 ($1000); live account spending and launch limits also apply."
    • addedInput schema / properties / automatic / default
      Added value: +false
    • addedInput schema / properties / automatic / description
      Added value: +"Use a previously recorded bounded funding mandate; false for an ordinary one-time purchase."
    • addedInput schema / properties / idempotency_key / description
      Added value: +"Caller-generated key, 8–128 letters, digits, underscores, dots, colons or hyphens. Reuse for retries of the same purchase or operation. Different input with the same organization-bound key returns a conflict."
    • removedInput schema / properties / idempotency_key / maxLength
      Removed value: -4096
    • removedInput schema / properties / idempotency_key / minLength
      Removed value: -1
    • addedInput schema / properties / idempotency_key / pattern
      Added value: +"^[A-Za-z0-9_.:-]{8,128}$"
    • addedInput schema / properties / payment_authorization / description
      Added value: +"MPP card authorization responding to this purchase's payment_challenge. Omit on the first call; never place the account Bearer token here."
  2. First observed

TDQS

A4/5.0
Behavior5/5

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

Annotations only cover readOnly=false, idempotent=true, openWorld=true, destructive=false. The description goes well beyond them, disclosing the auth requirement (billing scope), the live 402 payment-challenge retry path, that the authorization must be sent separately from the Bearer token, that provider confirmation credits the balance exactly once, that sandbox purchases are simulated, and that cards are supported while stablecoins are not. These are exactly the operational traits an agent cannot infer from 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.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The core action is front-loaded in the first sentence, followed by requirements and then the payment flow. Six sentences is dense, but each carries distinct information (flow, idempotency semantics, sandbox, supported instruments) with little redundancy. Slightly list-like, but no filler sentences that fail to earn their place.

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?

There is no output schema, so the description must carry return behavior, and it does explain the outcome ('credits the balance exactly once') and the intermediate 402 challenge. Combined with 100% schema coverage on four parameters, an agent has enough to call it correctly. Only finer response detail (e.g., what the success payload contains) is left implicit.

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 description coverage is 100%, so a baseline of 3 applies, but the description adds real meaning: it pins the currency/units ('in USD cents'), confirms the idempotency-key requirement, and clarifies that payment_authorization is a separate credential from the account Bearer token. That last point materially disambiguates how the parameter is supplied.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a specific verb and resource: 'Purchase organization-bound prepaid service credits in USD cents.' That is unambiguous and clearly distinct from siblings like get_balance or set_spending_policy. It stops short of naming or contrasting any sibling, so it lands at 4 rather than 5.

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 through the two-phase flow ('retry the same purchase/key with payment_authorization') and states prerequisites ('Requires billing scope and an idempotency key'). However, it never says when to choose this tool over funding-adjacent alternatives such as set_spending_policy, nor states any exclusions. That is implied rather than explicit guidance.

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