Skip to main content
Glama

purchase

Execute a paid tool by providing a valid x402 payment header. Returns the tool result and a signed receipt with transaction hash. Use this to purchase any paid tool in one atomic call.

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": {
      "tool_name": "<tool_name>",
      "arguments": "<arguments>",
      "x_payment": "<x_payment>"
    },
    "name": "purchase"
  }
}

Input Schema

NameRequiredDescriptionDefault
argumentsYesArguments for the tool
tool_nameYesName of the paid tool to execute
x_paymentYesBase64-encoded x402 payment header (X-PAYMENT)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

B3.4/5.0
Behavior3/5

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

With no annotations, the description carries the full burden, and it does disclose useful traits: atomicity, a returned tool result, and a signed receipt with a transaction hash. It omits financially material behavior — cost, whether payment is consumed on failure, retry semantics, and where the X-PAYMENT header comes from — which matters greatly for a payment tool.

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?

Two compact sentences, front-loaded with the action and its precondition, with no filler. Slight deduction only because the return-value sentence could be merged into the first for even tighter flow.

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?

Given a payment-bearing tool with no annotations and no output schema, the definition covers what it does and what it returns but leaves the payment lifecycle underspecified: obtaining the header, failure/refund behavior, and cost discovery are absent. Adequate to attempt a call, not adequate to call it safely.

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 description coverage is 100% and the schema already documents all three fields, including that x_payment is a Base64-encoded X-PAYMENT header. The description reinforces but does not extend this, so the baseline of 3 applies; nothing is added about valid formats or the nested `arguments` shape.

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 pairs a specific verb with a specific resource: 'Execute a paid tool by providing a valid x402 payment header', and clarifies that payment and execution happen together. It implicitly separates itself from the read-only siblings (get_*, list_*), though it never names a concrete alternative.

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

Usage Guidelines3/5

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

'Use this to purchase any paid tool in one atomic call' gives a positive trigger condition, but there is no guidance on when NOT to use it (e.g., calling a free tool directly), what to do when no payment header exists, or how to obtain one first. Usage is implied rather than spelled out.

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