Skip to main content
Glama

create_checkout_session

Create a Stripe Checkout link for an end user to buy credits; returns checkout_url and session_id. Nothing is charged until the buyer pays on that page; credits are issued when payment completes. Price either a pricing tier (pricing_tier_id, optionally × quantity) or a custom amount (credit_type_id + amount credits, priced at the credit type's exchange_rate). billing: "recurring" creates a subscription (tier required; billing_type recurring or both), credited on every paid invoice; otherwise it is a one-time purchase even on a recurring tier. save_payment_method: true (one-time only) keeps the card for charge_saved_card and auto top-up. success_url and cancel_url must be https on a Cred host or a domain listed under Dashboard → Payments → Allowed redirect domains; on any other domain the link is still created and silently redirects to Cred's default pages. Requires an sk_live_ API key. Not CRD-metered.

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>"
    },
    "name": "create_checkout_session"
  }
}

Input Schema

NameRequiredDescriptionDefault
amountNoCustom-amount checkout: number of credits to sell
api_keyNoCred API key (optional if set via the x-api-key header)
billingNoDefault one_time
user_idYesExternal user ID of the buyer (created if new)
quantityNoTier packs (or seats for a subscription); default 1
user_nameNoBuyer display name
cancel_urlNoRedirect if the buyer cancels, on an allowed domain (else Cred's default page, no error)
project_idNoCred project ID (optional; the API key already identifies the project. Signed in with 1Profile and owning several projects, it picks one)
signup_urlNoApp/page URL the buyer came from (attribution)
user_emailNoBuyer email (prefills Checkout, matched first)
success_urlNoRedirect after payment, on an allowed domain (else Cred's default page, no error)
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 with amount, and with a tier that allows several types (400 CREDIT_TYPE_REQUIRED otherwise).
pricing_tier_idNoTier to sell
save_payment_methodNoSave the card for off-session charges (one-time checkouts only)

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 load and does it well: nothing is charged until the buyer pays, credits are issued on payment completion, an sk_live_ key is required, and off-domain redirect URLs silently fall back to Cred's default pages without error. It also discloses that non-recurring checkouts don't meter CRD, which materially affects agent behavior.

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-loaded with the core purpose and return values, then layered conditions. It is dense but every clause carries decision-relevant information; slight packing of the pricing, billing, and URL rules into long sentences costs a point.

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 15-parameter mutation tool with no output schema, the description covers return values, pricing modes, billing behavior, redirect constraints, auth requirements, and downstream effects. An agent has enough to invoke it correctly without opening sibling docs.

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 already 100%, so the baseline is 3, but the description adds cross-parameter semantics the schema doesn't spell out: billing='recurring' requires a tier and a recurring/both billing_type, amount pairs with credit_type_id, and save_payment_method is one-time only. These couplings reduce misuse beyond per-field docs.

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 ('Create a Stripe Checkout link for an end user to buy credits') and names the return values (checkout_url, session_id). It also implicitly distinguishes itself from charge_saved_card and auto top-up by describing how saved payment methods are used downstream.

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 clear conditional routing: tier-based vs custom-amount pricing, recurring vs one-time billing, and one-time-only scope for save_payment_method. It references charge_saved_card and auto top-up as related flows but does not explicitly say when to prefer a sibling like create_subscription_portal_link or buy_credits_x402.

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