Skip to main content
Glama

purchase_product_with_payment

Complete a public product purchase after you have obtained a valid signed x402 payment (v2 or v1) for that product challenge.

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": {
      "productIdOrSlug": "<productIdOrSlug>",
      "paymentPayload": "<paymentPayload>"
    },
    "name": "purchase_product_with_payment"
  }
}

Input Schema

NameRequiredDescriptionDefault
metadataNoOptional metadata object forwarded to the purchase flow
paymentPayloadYesSigned x402 payment from the paying client (v2 relayed as PAYMENT-SIGNATURE, v1 as X-Payment), as JSON or base64 string
productIdOrSlugYesProduct slug or product ID used in the public /p/:id-or-slug purchase route
clientReferenceIdNoOptional client reference ID forwarded to the purchase flow

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / paymentPayload / description
      Previous value: -"Raw X-Payment payload returned by the paying client, as JSON or base64 string"New value: +"Signed x402 payment from the paying client (v2 relayed as PAYMENT-SIGNATURE, v1 as X-Payment), as JSON or base64 string"
  2. Added

TDQS

B3.4/5.0
Behavior2/5

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

No annotations are supplied, so the description carries the full burden. It never states that this irreversibly spends funds, whether re-submitting the same paymentPayload is safe, what an expired/already-consumed payment returns, or whether clientReferenceId provides idempotency. For a money-moving terminal step, these omissions are material.

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?

A single front-loaded sentence with the action first and the precondition second, and no filler. It is dense but every clause carries information; only the parenthetical version detail is redundant with the schema.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With no annotations and no output schema, the description is the only place a reader could learn what a successful purchase returns (order, entitlement, receipt) or what failures look like. It covers the input precondition adequately but leaves the outcome and error surface entirely undocumented for a nested-object, payment-spending tool.

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 both required parameters are already documented in detail, and the description's mention of v2/v1 payment formats duplicates the schema. It adds no meaning about what shape the paymentPayload must match or how metadata/clientReferenceId affect the purchase flow.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description gives a specific verb and resource ('Complete a public product purchase') plus the gating condition (a valid signed x402 payment). That distinguishes it from the sibling 'request_product_purchase_payment', which by name obtains the payment this tool consumes. It stops short of naming that sibling explicitly.

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?

The sequencing cue 'after you have obtained a valid signed x402 payment' clearly tells the agent this is the second step and cannot be called cold. There is no explicit when-not guidance, no mention that a prior request/quote step produces the payment, and no exclusions for the credit-based siblings.

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