Skip to main content
Glama

redeem_credits

MOVES MONEY: cash out a user's credits as a Stripe transfer to a connected account. Deducts amount credits and pays amount × the credit type's exchange_rate (USD per credit; the rate cannot be overridden). The credit type must be redeemable (else 400 NOT_REDEEMABLE). destination must be this user's own account from onboard_payout_account (else 400 INVALID_DESTINATION). Pass idempotency_key: a retry with the same key returns the first result (idempotent_replay: true) and never deducts or pays twice; without one, reference_id is the key, and with neither every call redeems again. 502 PAYOUT_PENDING means Stripe's answer was lost: retry with the SAME key (idempotency_key in the error) to finish it — if nobody retries, the reconciliation sweep settles it after ~15 minutes (paid, or credits returned only if Stripe definitely refused); a claim it cannot settle safely is flagged for manual review. Errors: 400 INSUFFICIENT_CREDITS, 400 PAYOUT_TOO_SMALL, 404 USER_NOT_FOUND, 402 STRIPE_TRANSFER_FAILED (credits restored), 409 IDEMPOTENCY_KEY_REUSED. 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": {
      "credit_type_id": "<credit_type_id>",
      "amount": "<amount>",
      "destination": "<destination>"
    },
    "name": "redeem_credits"
  }
}

Input Schema

NameRequiredDescriptionDefault
amountYesCredits to redeem
reasonNoReason, shown on the transfer and ledger
api_keyNoCred API key (optional if set via the x-api-key header)
user_idNoExternal user ID
currencyNoPayout currency (default usd)
metadataNoString key/values added to the Stripe transfer metadata
project_idNoCred project ID (optional; the API key already identifies the project. Signed in with 1Profile and owning several projects, it picks one)
user_emailNoUser email (alternative)
destinationYesStripe connected account ID (acct_…) that receives the payout
reference_idNoYour reference, stored on the transfer and ledger
x402_paymentNoBase64 x402 PaymentPayload, only when a previous call failed with an x402 PaymentRequired because the account is out of CRD
credit_type_idYesRedeemable credit type
idempotency_keyNoUnique key for this redemption (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.

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.1/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and mostly delivers: exchange-rate determination, non-overridable rate, idempotency semantics, 502 PAYOUT_PENDING reconciliation behavior, and per-call CRD cost with rate-limit exception. Gaps remain on what a success response contains and whether a transfer can be reversed, which matter for a money-moving mutation.

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 the money-moving warning and the core mechanics, then moves to idempotency, failure recovery, and errors in a sensible order. It is dense and long, but nearly every clause carries operational information; only the reconciliation-sweep detail could be tightened.

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 13-parameter, high-stakes payout tool with no output schema and no annotations, the description supplies the error taxonomy, retry protocol, and cost model an agent needs to act safely. What's missing is the success-path return shape, which matters because there is no output schema to cover it.

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%, so the baseline is 3; the description does add value by explaining that amount is multiplied by the credit type's exchange rate and that reference_id serves as a fallback idempotency key. It says nothing about reason, metadata, currency, or x402_payment beyond what the schema already states, so it does not meaningfully exceed baseline.

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 a specific verb and resource plus a scope warning: "MOVES MONEY: cash out a user's credits as a Stripe transfer to a connected account." That distinguishes it clearly from sibling tools like deduct_credits and issue_credits, which don't pay out via Stripe.

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?

States prerequisites clearly: the credit type must be redeemable and destination must be the user's own account from onboard_payout_account, plus explicit guidance to pass idempotency_key per intended operation. It lacks an explicit statement of when to prefer a sibling like deduct_credits for non-payout deductions, but the payout framing narrows usage well.

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