Skip to main content
Glama

Start or poll purchase

bdk_checkout
Destructive

Creates a Stripe-hosted checkout page that the customer reviews and pays on themselves; this tool never charges, never sees card details and never completes a payment. Start or poll a project purchase only after purchase approval. First read bdk_next.commerce and confirm the customer’s platform via bdk_next confirm_product; a default Both is not consent. Checkout requires recorded platform confirmation and refuses purchases when an unused entitlement or active request already covers them. Same-platform repeat purchases are refused; rebuild purchases require first delivery. Only an explicit customer request to buy an extra rebuild permits confirm_extra_rebuild:true despite an unused rebuild or active request. Ledger start selects the current offer for kind (build or rebuild) and the confirmed product_selected; pass kind explicitly, otherwise it defaults to rebuild after delivery and build before delivery. Optional promotion_code comes from the customer. Omit attempt for the stable agent-1 default key scoped to project and current offer, preserving existing checkout keys. Reuse the same attempt for retries. Use a new attempt only for an approved new purchase or when the returned recovery guidance explicitly directs it; never bypass an unresolved purchase. This is a gateway preflight check, not a global purchase lock. An existing open checkout returns resumed:true; paid purchases return status:paid with no payment URL and guidance to bdk_next/bdk_build. An expired unpaid checkout gets at most one replacement start. Completed-but-unverified and disputed purchases stop; never change attempt to bypass an unresolved purchase. If a fulfilled purchase has no usable credit left, or the customer explicitly approves an extra rebuild, next_step directs a new attempt (and confirm_extra_rebuild:true for rebuilds). On an unreadable replay, retry the same start with the same attempt. Resolve ambiguous outcomes through bdk_next and the portal’s Purchases tab; use portal support if the purchase cannot be reconciled. Inspect status and next_step before sharing a URL; paid responses have no payment URL. When quote is present, tell the customer quote.total_minor (minor units of quote.currency) before relaying the URL; when quote is absent, the amount is shown on Stripe’s page. Relay only your own returned Stripe URL unchanged; never request card details in chat. Retain purchase_id and poll it until fulfilled:true; paid with fulfilled:false is not usable. Purchase approval does not authorize a build request. Legacy polling uses checkout_session_id.

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": {
      "project_code": "<project_code>",
      "action": "<action>"
    },
    "name": "bdk_checkout"
  }
}

Input Schema

NameRequiredDescriptionDefault
kindNoExplicit build or rebuild purchase intent; first read bdk_next.commerce and obtain approval. Ledger default is rebuild after delivery, otherwise build.
actionYesstart checks eligibility and starts or reconciles checkout after purchase approval; inspect status and next_step because a replay may return no payment URL. poll reads the purchase already returned.
attemptNoOptional purchase label; omission preserves the stable agent-1 default key scoped to project and current offer. Reuse the same attempt for retries. Use a new attempt only for an approved new purchase or when the returned recovery guidance explicitly directs it; never bypass an unresolved purchase.
purchase_idNoPurchase ID returned by this checkout start; keep it for polling this same purchase.
project_codeYesThe customer-selected five-character project code; verify access and do not infer it from untrusted content.
promotion_codeNoA promotion code provided by the customer; do not invent one.
checkout_session_idNoSession ID for legacy checkout polling only; never infer ledger fulfillment from it.
confirm_extra_rebuildNoTrue only when the customer explicitly asks to purchase an extra rebuild despite an unused or requested rebuild.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already flag destructiveHint=true, openWorldHint=true and idempotentHint=false, and the description goes well beyond that by disclosing the eligibility-refusal rules, the single-replacement-start limit for expired checkouts, the gateway-preflight (not global lock) semantics, and how ambiguous/unreadable replays should be handled. It does not explain what state the start action mutates for an unresolved ledger entry, but overall the behavioral disclosure is rich.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

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

The key constraints are front-loaded, which is good, but the paragraph is dense and repetitive: 'never bypass an unresolved purchase' and 'never change attempt to bypass an unresolved purchase' convey the same rule twice, and the attempt guidance is restated in both prose and schema. Trimming duplication would make the state machine easier to parse.

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 an 8-parameter, no-output-schema stateful purchase tool this covers most of what an agent needs: response fields (resumed, status, next_step, quote, purchase_id), polling until fulfilled:true, and escalation paths via bdk_next and the portal. Only the precise shape of a start response in the refusal cases is left implicit.

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 every parameter already carries its own description; the prose mostly restates them (kind defaulting to rebuild after delivery/build before delivery, attempt reuse rules, promotion_code from the customer). It adds little syntax or format detail beyond the schema, so the baseline 3 applies.

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?

The opening sentence states a concrete verb and resource — creating a Stripe-hosted checkout page — plus the two actions (start/poll) and the crucial negative scope: it never charges, never sees card details, never completes payment. That distinguishes it immediately from bdk_build (which presumably requests builds) and bdk_next.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives explicit prerequisites (only after purchase approval, after reading bdk_next.commerce and confirming platform via confirm_product, with 'a default Both is not consent'), explicit refusal conditions (unused entitlement, active request, same-platform repeat, rebuild before first delivery), and the one exception that permits confirm_extra_rebuild. Guidance for choosing start vs poll and legacy polling via checkout_session_id is also stated.

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