Skip to main content
Glama

Commerce Decision

commerce-decision
Idempotent

Before an autonomous agent pays an x402 challenge, bind the request, accepted payment offer, and machine spending policy into a deterministic GO/WARN/BLOCK decision with SHA-256 commitments. Price: $0.02 via x402. Generate one _salt19_operation_id per intended purchase, preserve it across retries, and add _x402_payment_signature after satisfying the challenge. A stable _salt19_operation_id is required and makes semantic retries at-most-once. _salt19_operation_id is recommended but optional for standard x402 compatibility.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
policyYesInput parameter "policy" for the commerce-decision tool.
requestYesInput parameter "request" for the commerce-decision tool.
payment_requiredYesInput parameter "payment_required" for the commerce-decision tool.
_salt19_handoff_idNoOptional SALT19 authorization handoff correlation. Preserve the same value across challenge, local signing, and paid retry.
_salt19_operation_idNoOptional but recommended semantic purchase identifier. Generate once per intended purchase and preserve it across challenge, payment, timeout recovery, and retries for the strongest at-most-once contract. Standard x402 clients may omit it.
_x402_payment_signatureNoOptional x402 PAYMENT-SIGNATURE proof. Omit on the first call to receive the payment challenge; include after satisfying that challenge.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
toolNoCanonical SALT19 tool identifier when the result is tool-specific.
statusNoSALT19 execution, payment, availability, or verification state.
responseNoTool-specific structured response payload when execution completes.
operation_idNoClient-controlled semantic purchase identifier when applicable.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.7/5.0
Behavior3/5

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

Annotations indicate idempotentHint=true, readOnlyHint=false, destructiveHint=false. The description adds context about the need to preserve _salt19_operation_id across retries to achieve at-most-once semantics, which complements the idempotency hint. It also mentions returning a decision (GO/WARN/BLOCK) with commitments. However, it does not fully clarify side effects (e.g., whether the tool itself initiates payment or only decides), and the pricing mention is minor. It does not contradict annotations.

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 description is slightly verbose, with three sentences that mix instructions, pricing, and implementation details. The key purpose and usage are front-loaded, but the pricing and recommendation could be condensed. The use of underscores in parameter names (e.g., _salt19_operation_id) is awkward in prose, but overall it is readable and not overly long.

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?

The tool has a complex input schema with nested objects and 6 parameters, and the description explains the multi-step payment flow (first call to get challenge, then include signature). An output schema exists, so the decision output is likely self-explanatory. However, it could better clarify the relationship with sibling tools like 'x402-payment-preflight' to avoid redundant calls, but for its core purpose it is sufficient.

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 100%, so the baseline is 3. The description adds value beyond schema by explaining the functional role of _salt19_operation_id, _salt19_handoff_id, and _x402_payment_signature in the payment flow, and the recommendation to preserve operation_id across retries. It also clarifies the interplay between payment_required and retries. This extra semantic guidance justifies a 4.

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 clearly identifies the tool's purpose: to bind request, payment offer, and policy into a GO/WARN/BLOCK decision, using SHA-256 commitments. It goes beyond a tautology by specifying the inputs and decision output. However, it does not explicitly differentiate from similar sibling tools like 'x402-payment-preflight' or 'commerce-verify', which could cause overlap ambiguity.

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?

It states when to use: 'Before an autonomous agent pays an x402 challenge', and implies an alternative is standard x402 clients that may omit the operation ID. It also introduces the concept of _salt19_operation_id for at-most-once semantics, which is a clear usage context. However, it does not explicitly mention when to use a different sibling tool, such as 'x402-payment-preflight' for pre-flight checks rather than decisions.

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