Skip to main content
Glama

Hearth: x402 Pay-Safety & Discovery

x402_precheck

Read-only

x402 pre-payment safety check: pay / caution / avoid. Before your agent pays an unknown x402 endpoint, check it ($0.005). Give an x402 URL and/or payTo; optional maxPrice to catch bait-and-switch. Live unpaid probe (GET then POST) parsing x402 v1 body AND v2 header; canonical USDC contract, network, price, timeout; payTo hijack / v1-v2 mismatch; payTo wallet on Base: ~75h of USDC inflows, distinct payers, self-funding concentration, fresh-wallet; Coinbase Bazaar + PayAI 30-day payers/calls with wallet-farming, keep-alive self-payment and listing-carpet detection; price vs median of comparable paid listings. Returns schema hearth.precheck.v2: verdict (pay/caution/avoid), allow, 0-100 score, confidence, coded reasons [{code,severity,detail}] and signals. Batch: /v1/x402/precheck-batch. Example output: {"schema":"hearth.precheck.v2","verdict":"pay","allow":true,"score":90,"confidence":"high","reasons":[],"signals":[{"code":"valid_402","severity":"info","detail":"valid x402 v2 challenge via POST"},{"code":"organic_catalog_usage","severity":"info","detail":"92 payers / 8960 calls in 30d"}],"priceUsd. Price: $0.005 USDC on Base via x402 (pass the payment in _meta["x402/payment"]).

Input Schema

NameRequiredDescriptionDefault
urlNox402 resource URL to check
deepNo1 = force a live ~75h on-chain scan instead of the index (slower)
payToNoExpected payTo (0x…, Base); flags payTo hijack
methodNoGET or POST (default: try GET then POST)
maxPriceNoMax USD you expect to pay; flags bait-and-switch pricing

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changed
    • addedInput schema / properties / deep
      Added value: +{
      +  "description": "1 = force a live ~75h on-chain scan instead of the index (slower)",
      +  "type": "string"
      +}
    • addedInput schema / properties / maxPrice
      Added value: +{
      +  "description": "Max USD you expect to pay; flags bait-and-switch pricing",
      +  "type": "string"
      +}
    • changedInput schema / properties / method / description
      Previous value: -"GET (default) or POST to probe the endpoint"New value: +"GET or POST (default: try GET then POST)"
    • changedInput schema / properties / payTo / description
      Previous value: -"Expected/known payTo address (0x…, Base). Optional if url given."New value: +"Expected payTo (0x…, Base); flags payTo hijack"
  2. Added

TDQS

A4.2/5.0
Behavior5/5

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

Annotations only declare readOnlyHint and openWorldHint, but the description adds substantial behavioral context: a live unpaid GET-then-POST probe, v1 body and v2 header parsing, the specific detection categories (payTo hijack, v1-v2 mismatch, wallet farming, keep-alive self-payment), the on-chain lookback window (~75h), and the index-vs-live-scan distinction. It also discloses the tool's own payment mechanics ($0.005 USDC on Base via _meta['x402/payment']), which is essential and appears nowhere in the annotations or schema.

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 verdict and when-to-use are correctly front-loaded, but the body is a dense semicolon chain of internal jargon (Coinbase Bazaar, PayAI, listing-carpet detection) and ends in a corrupted fragment: the example JSON is truncated at 'priceUsd.' before the pricing sentence resumes. Restructuring the example and pruning enumeration detail would improve it.

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 carries the return-value burden and does so: it names hearth.precheck.v2, enumerates verdict/allow/score/confidence/reasons/signals, and supplies a concrete example object. The truncated example tail is the one real gap, but an agent still knows what will come back and how to interpret it.

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 five parameters are already documented, which sets the baseline at 3. The description restates url, payTo, and maxPrice with the same intent already present in the schema ('catch bait-and-switch' mirrors 'flags bait-and-switch pricing') and says nothing about `deep` or `method` beyond the probe description, so it adds marginal value only.

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 up front: 'x402 pre-payment safety check: pay / caution / avoid', with the three-valued verdict scale explicit. It distinguishes itself from siblings by naming the batch variant (/v1/x402/precheck-batch) and by framing the operation as a pre-payment probe, which is distinct from x402_discover or the on-chain wallet tools.

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?

Gives a clear trigger: 'Before your agent pays an unknown x402 endpoint, check it', plus the cost context ($0.005) and required inputs (url and/or payTo). It routes to the batch sibling for volume use. It does not explicitly say when NOT to use this versus x402_discover, so it stops short of a full when/when-not/alternatives statement.

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