Skip to main content
Glama

charge_saved_card

MOVES MONEY: charge a user's saved card off-session for one pack of a one-time pricing tier and credit it. idempotency_key is required; a retry with the same key never charges twice and returns the first outcome (replayed: true). Outcomes: 200 status succeeded (credits, new_balance); 202 status processing (not yet settled — retry later with the SAME key to check, never a new key); 402 status failed with code/decline_code (requires_action: true means the buyer must pay through checkout instead). Other errors: 404 no_saved_payment_method, 409 saved_payment_method_unusable, 400 tier_not_one_time, 502 charge_not_started (retry with the same key). Costs 1 CRD (platform credit) per call, charged even when the call is then rejected (a 429 RATE_LIMITED costs nothing). Error results include request_id; quote it to support.

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": {
      "user_id": "<user_id>",
      "pricing_tier_id": "<pricing_tier_id>",
      "idempotency_key": "<idempotency_key>"
    },
    "name": "charge_saved_card"
  }
}

Input Schema

NameRequiredDescriptionDefault
api_keyNoCred API key (optional if set via the x-api-key header)
user_idYesExternal user ID of the card holder
project_idNoCred project ID (optional; the API key already identifies the project. Signed in with 1Profile and owning several projects, it picks one)
x402_paymentNoBase64 x402 PaymentPayload, only when a previous call failed with an x402 PaymentRequired because the account is out of CRD
credit_type_idNoCredit type to grant. Required when the tier allows several types (400 CREDIT_TYPE_REQUIRED otherwise)
idempotency_keyYesUnique key for this charge (max 255 chars). Retrying with the same key and same arguments returns the first result instead of repeating it; reusing it for different arguments fails with 409 IDEMPOTENCY_KEY_REUSED. Generate a fresh key (e.g. a UUID) per intended operation and reuse it only to retry that operation.
pricing_tier_idYesOne-time (or both) pricing tier to buy

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / project_id / description
      Previous value: -"Cred project ID (optional; the API key already identifies the project)"New value: +"Cred project ID (optional; the API key already identifies the project. Signed in with 1Profile and owning several projects, it picks one)"
  2. First observed

TDQS

A4.6/5.0
Behavior5/5

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

With no annotations, the description carries the full behavioral burden and does so thoroughly: it discloses the 1 CRD cost per call, that the cost is charged even on rejection but not on 429, idempotency/replay semantics with a replayed:true marker, and the complete outcome map (200/202/402 plus 404/409/400/502). It even notes that error results carry a request_id to quote to support.

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?

The money-moving nature and primary purpose are front-loaded in the first clause, then the retry contract, then the outcome codes in escalating order. Despite its density, every sentence adds operational information an agent needs, and there is no filler.

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?

Very complete for a payment mutation with no output schema: cost, idempotency, all status/error codes, and retry guidance are covered. The only mild gap is the absence of guidance on how a processing (202) charge should be polled in terms of timing, though the same-key retry rule is stated.

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 a baseline of 3 applies, but the description adds genuine meaning about the idempotency_key beyond the schema's field description — namely that retries with the same key never double-charge and return the first outcome, and that a new key must never be used to poll a processing charge. Other parameters (credit_type_id, project_id, x402_payment) are left to the already-thorough schema.

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?

Opens with an explicit action framing ("MOVES MONEY") followed by a precise verb+resource: charging a user's saved card off-session for one pack of a one-time pricing tier. It also implicitly distinguishes itself from a checkout-based flow by noting that a requires_action buyer must pay through checkout instead.

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?

Clearly states the context in which this tool applies (off-session charge on a saved payment method) and routes the agent elsewhere when requires_action is true (buyer must pay through checkout). It does not name specific sibling tools, so the routing is by condition rather than by explicit alternative name.

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