Skip to main content
Glama

BDK Native

Start or poll purchase

bdk_checkout
Destructive

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.

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

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

Annotations already flag it as mutating, destructive, non-idempotent and open-world, and the description adds far more: it is a preflight gate not a global lock, refused states (unused entitlement, active request, completed-but-unverified, disputed), resumed:true semantics, at-most-one replacement for expired checkouts, and the no-card-details-in-chat rule. This is disclosure beyond the annotations, not a restatement.

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 purpose is front-loaded, but the body is a dense run-on of operating rules with no structure and noticeable duplication of the schema parameter text (attempt, kind). Every rule is relevant, yet the length and lack of grouping make it costly to parse.

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 complex 8-parameter gateway with no output schema, the description covers return states (resumed:true, status:paid, next_step, quote presence/absence), every refusal path, attempt recovery guidance and escalation. Nothing an agent needs to call it safely is missing.

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% and the input schema descriptions already carry attempt, kind and promotion_code semantics in nearly identical wording, so the description adds little parameter meaning beyond the schema. The only marginal addition is the customer-quote instruction, which concerns output rather than inputs. 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?

States a specific verb and resource ('Start or poll a project purchase') plus scope ('only after purchase approval') and explicitly routes to siblings bdk_next.commerce and bdk_next confirm_product. An agent can distinguish it from bdk_build and bdk_next without opening a schema.

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?

Extensive when-to-use: start vs poll is defined, prerequisites (read bdk_next.commerce, confirm platform) are mandated, exclusions are named (same-platform repeats refused, default 'Both' not consent, purchase approval does not authorize a build). Alternatives (bdk_next, portal Purchases tab, portal support) are given by condition.

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