Skip to main content
Glama
reciprocal-ruler-mcp
by hwcho310

Reciprocal Ruler - quote lock (x402 paid)

ruler_quote_lock
Idempotent

Locks agreed trade terms between two agents and returns a deterministic quote hash both sides can cite later; it rejects rule-version mismatches before charging.

Instructions

Lock the trade terms the two agents agreed on and get a deterministic quote_hash both sides can cite later. Costs $0.05 USDC on Base, paid with x402. Without a payment this tool returns the HTTP 402 payment challenge decoded into Base USDC instructions; pay it with an x402 wallet and pass the signed payload back as payment_header to complete the call. If the two agents run different rule versions the call is refused with VERSION_MISMATCH (409) and nothing is charged.

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": {
      "buyer_version": "<buyer_version>",
      "supplier_version": "<supplier_version>",
      "buyer_id": "<buyer_id>",
      "supplier_id": "<supplier_id>",
      "terms": "<terms>"
    },
    "name": "ruler_quote_lock"
  }
}

Input Schema

NameRequiredDescriptionDefault
termsYesAgreed terms, at minimum price_krw. Also useful: free_cancel_until, refund_ratio_on_cancel, holdback_ratio.
buyer_idYesIdentifier of the buyer agent.
supplier_idYesIdentifier of the supplier agent.
buyer_versionYesRule version the buyer agent runs, e.g. '1.0'.
payment_headerNoSigned x402 payment payload for this request (sent as X-PAYMENT). Omit it to receive the payment challenge.
supplier_versionYesRule version the supplier agent runs; must match buyer_version.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.9/5.0
Behavior4/5

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

Goes well beyond the annotations by disclosing the $0.05 USDC on Base cost, the x402 payment handshake, the 409 VERSION_MISMATCH refusal, and critically that nothing is charged on refusal. Missing detail on whether a lock can be amended or superseded later.

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?

Front-loaded with the outcome and the hash, then cost, then failure mode — a sensible ordering. The middle sentence is long and packs the entire payment handshake into one clause chain, but every sentence carries required information.

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?

With no output schema, the description compensates by naming the returned quote_hash and the two error outcomes (402 challenge, 409 mismatch). Adequate for a paid mutation tool; a note on what the lock prevents downstream would round it out.

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 all six parameters are already documented, including payment_header and the version-match requirement. The description reinforces the payment_header two-step pattern but adds no new meaning for buyer_id, supplier_id or the nested terms fields.

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?

"Lock the trade terms the two agents agreed on and get a deterministic quote_hash" gives a specific verb (lock), resource (trade terms) and return artifact (quote_hash). It is clearly not a reconciliation tool, though it never names ruler_reconcile or ruler_trial_reconcile to state the boundary 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?

It spells out the operating flow: call without payment to receive the HTTP 402 challenge, then pay with an x402 wallet and resubmit with payment_header. It also states the precondition for failure (agents on different rule versions), but gives no explicit guidance on choosing this over the reconcile siblings.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.