Skip to main content
Glama

alalanet — check before your agent installs, connects or pays

Decide before paying an x402 endpoint

preflight_payment
Read-only

Decision for one x402 payment, right before it is signed. Pass the endpoint url and the 402 it returned (PAYMENT-REQUIRED header value or JSON body), optionally max_usd and client (your x402 library and version: known payment flaws come back in client_advisories, not logged). Each payment option gets allow / hold / block with reasons. block: pay_to_unknown, pay_to_zero_address, pay_to_burn_address, pay_to_is_asset, pay_to_sanctioned, pay_to_frozen_by_issuer, service_not_working, over_budget, quote_expired (the option's own expiry passed); hold: pay_to_differs_from_listing, pay_to_never_seen, price_above_listing, price_above_observed, network_not_listed, asset_not_stablecoin, high_price ($5 or more), unknown_service, not_checked_yet, not_rated_yet, low_trust_score, listing_removed (its catalogue no longer lists it); info: pay_to_as_observed, pay_to_platform_wallet, amount_is_ceiling (scheme upto), frozen_status_unknown, testnet. The decision is bound to the payment hash, valid for up to 5 minutes (expires_at), signed and logged, except for an unlisted url that looks like it carries a key or token (then it is made for you only, with no attestation). allow: no problem found; hold: the user should confirm; block: do not pay.

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": {
      "url": "<url>"
    },
    "name": "preflight_payment"
  }
}

Input Schema

NameRequiredDescriptionDefault
urlYeshttps URL of the x402 endpoint you are about to pay
clientNooptional: your x402 client library and version, e.g. @x402/fetch@2.22.1 or pypi:x402@2.19.0; alalanet warns about versions with known payment flaws (not logged)
max_usdNoyour budget for this one call in US dollars; options above it are blocked
payment_requiredNothe 402 the endpoint returned: x402 PAYMENT-REQUIRED header value (base64) or JSON body, or an MPP WWW-Authenticate: Payment value; omit to judge the terms alalanet last observed

Output Schema

NameRequiredDescriptionDefault
chooseNo
meaningYes
optionsYes
serviceNo
decisionYes
expires_atYes
attestationNo
client_advisoriesNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed12 schema fields changed
    • removedOutput schema / additionalProperties
      Removed value: -false
    • removedOutput schema / properties / attestation / additionalProperties
      Removed value: -false
    • removedOutput schema / properties / attestation / properties
      Removed value: -{
      -  "event": {
      -    "additionalProperties": false,
      -    "properties": {
      -      "content": {
      -        "type": "string"
      -      },
      -      "created_at": {
      -        "type": "integer"
      -      },
      -      "id": {
      -        "type": "string"
      -      },
      -      "kind": {
      -        "type": "integer"
      -      },
      -      "pubkey": {
      -        "type": "string"
      -      },
      -      "sig": {
      -        "type": "string"
      -      },
      -      "tags": {
      -        "items": {
      -          "items": {
      -            "type": "string"
      -          },
      -          "type": [
      -            "null",
      -            "array"
      -          ]
      -        },
      -        "type": [
      -          "null",
      -          "array"
      -        ]
      -      }
      -    },
      -    "required": [
      -      "id",
      -      "pubkey",
      -      "created_at",
      -      "kind",
      -      "tags",
      -      "content",
      -      "sig"
      -    ],
      -    "type": "object"
      -  },
      -  "event_json": {
      -    "type": "string"
      -  },
      -  "how_to_verify": {
      -    "type": "string"
      -  },
      -  "log_index": {
      -    "type": "integer"
      -  },
      -  "log_key": {
      -    "type": "string"
      -  },
      -  "log_origin": {
      -    "type": "string"
      -  },
      -  "pending": {
      -    "type": "boolean"
      -  },
      -  "proof": {
      -    "additionalProperties": false,
      -    "properties": {
      -      "checkpoint": {
      -        "type": "string"
      -      },
      -      "hashes": {
      -        "items": {
      -          "type": "string"
      -        },
      -        "type": [
      -          "null",
      -          "array"
      -        ]
      -      },
      -      "index": {
      -        "minimum": 0,
      -        "type": "integer"
      -      },
      -      "leaf_hash": {
      -        "type": "string"
      -      },
      -      "root_hash": {
      -        "type": "string"
      -      },
      -      "tree_size": {
      -        "minimum": 0,
      -        "type": "integer"
      -      }
      -    },
      -    "required": [
      -      "index",
      -      "tree_size",
      -      "root_hash",
      -      "leaf_hash",
      -      "hashes",
      -      "checkpoint"
      -    ],
      -    "type": [
      -      "null",
      -      "object"
      -    ]
      -  },
      -  "server_pubkey": {
      -    "type": "string"
      -  },
      -  "signer": {
      -    "type": "string"
      -  }
      -}
    • removedOutput schema / properties / attestation / required
      Removed value: -[
      -  "event",
      -  "event_json",
      -  "log_index",
      -  "log_origin",
      -  "log_key",
      -  "server_pubkey",
      -  "signer",
      -  "how_to_verify"
      -]
    • removedOutput schema / properties / choose / additionalProperties
      Removed value: -false
    • removedOutput schema / properties / choose / properties
      Removed value: -{
      -  "amount": {
      -    "type": "string"
      -  },
      -  "asset": {
      -    "type": "string"
      -  },
      -  "decision": {
      -    "type": "string"
      -  },
      -  "network": {
      -    "type": "string"
      -  },
      -  "pay_to": {
      -    "type": "string"
      -  },
      -  "payment_hash": {
      -    "type": "string"
      -  },
      -  "price": {
      -    "type": "string"
      -  },
      -  "reasons": {
      -    "items": {
      -      "type": "string"
      -    },
      -    "type": [
      -      "null",
      -      "array"
      -    ]
      -  },
      -  "usd": {
      -    "type": [
      -      "null",
      -      "number"
      -    ]
      -  }
      -}
    • removedOutput schema / properties / choose / required
      Removed value: -[
      -  "network",
      -  "asset",
      -  "amount",
      -  "price",
      -  "pay_to",
      -  "decision",
      -  "payment_hash"
      -]
    • removedOutput schema / properties / client_advisories / items
      Removed value: -{
      -  "additionalProperties": false,
      -  "properties": {
      -    "below": {
      -      "type": "string"
      -    },
      -    "fixed_in": {
      -      "type": "string"
      -    },
      -    "from": {
      -      "type": "string"
      -    },
      -    "id": {
      -      "type": "string"
      -    },
      -    "package": {
      -      "type": "string"
      -    },
      -    "published": {
      -      "type": "string"
      -    },
      -    "severity": {
      -      "type": "string"
      -    },
      -    "source": {
      -      "type": "string"
      -    },
      -    "summary": {
      -      "type": "string"
      -    }
      -  },
      -  "required": [
      -    "id",
      -    "package",
      -    "below",
      -    "severity",
      -    "summary",
      -    "fixed_in",
      -    "source",
      -    "published"
      -  ],
      -  "type": "object"
      -}
    • removedOutput schema / properties / options / items
      Removed value: -{
      -  "additionalProperties": false,
      -  "properties": {
      -    "amount": {
      -      "type": "string"
      -    },
      -    "asset": {
      -      "type": "string"
      -    },
      -    "decision": {
      -      "type": "string"
      -    },
      -    "network": {
      -      "type": "string"
      -    },
      -    "pay_to": {
      -      "type": "string"
      -    },
      -    "payment_hash": {
      -      "type": "string"
      -    },
      -    "price": {
      -      "type": "string"
      -    },
      -    "reasons": {
      -      "items": {
      -        "type": "string"
      -      },
      -      "type": [
      -        "null",
      -        "array"
      -      ]
      -    },
      -    "usd": {
      -      "type": [
      -        "null",
      -        "number"
      -      ]
      -    }
      -  },
      -  "required": [
      -    "network",
      -    "asset",
      -    "amount",
      -    "price",
      -    "pay_to",
      -    "decision",
      -    "payment_hash"
      -  ],
      -  "type": "object"
      -}
    • removedOutput schema / properties / service / additionalProperties
      Removed value: -false
    • removedOutput schema / properties / service / properties
      Removed value: -{
      -  "advice": {
      -    "type": "string"
      -  },
      -  "agents_with_confirmed_use": {
      -    "type": "integer"
      -  },
      -  "alalanet_test_purchase": {
      -    "additionalProperties": false,
      -    "properties": {
      -      "at": {
      -        "type": "string"
      -      },
      -      "bytes": {
      -        "type": "integer"
      -      },
      -      "http_status": {
      -        "type": "integer"
      -      },
      -      "note": {
      -        "type": "string"
      -      },
      -      "outcome": {
      -        "type": "string"
      -      },
      -      "response_sha256": {
      -        "type": "string"
      -      },
      -      "tx": {
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "at",
      -      "outcome",
      -      "http_status",
      -      "bytes",
      -      "tx",
      -      "note"
      -    ],
      -    "type": [
      -      "null",
      -      "object"
      -    ]
      -  },
      -  "alive": {
      -    "type": "boolean"
      -  },
      -  "catalog_price": {
      -    "type": "string"
      -  },
      -  "checked_at": {
      -    "type": "string"
      -  },
      -  "checks_7d": {
      -    "type": "integer"
      -  },
      -  "confirmed_agent_receipts": {
      -    "type": "integer"
      -  },
      -  "description": {
      -    "type": "string"
      -  },
      -  "detail": {
      -    "type": "string"
      -  },
      -  "flags": {
      -    "items": {
      -      "type": "string"
      -    },
      -    "type": [
      -      "null",
      -      "array"
      -    ]
      -  },
      -  "host": {
      -    "type": "string"
      -  },
      -  "host_listings": {
      -    "type": "integer"
      -  },
      -  "id": {
      -    "type": "string"
      -  },
      -  "last_alive_at": {
      -    "type": "string"
      -  },
      -  "latency_ms": {
      -    "type": "integer"
      -  },
      -  "name": {
      -    "type": "string"
      -  },
      -  "network": {
      -    "type": "string"
      -  },
      -  "onchain_payers_30d": {
      -    "additionalProperties": false,
      -    "properties": {
      -      "distinct_payers": {
      -        "type": "integer"
      -      },
      -      "network": {
      -        "type": "string"
      -      },
      -      "note": {
      -        "type": "string"
      -      },
      -      "payments": {
      -        "type": "integer"
      -      },
      -      "repeat_payers": {
      -        "type": "integer"
      -      },
      -      "since": {
      -        "type": "string"
      -      },
      -      "top_payer_share": {
      -        "type": "number"
      -      },
      -      "usd": {
      -        "type": "number"
      -      }
      -    },
      -    "required": [
      -      "payments",
      -      "distinct_payers",
      -      "repeat_payers",
      -      "top_payer_share",
      -      "usd",
      -      "network",
      -      "since",
      -      "note"
      -    ],
      -    "type": [
      -      "null",
      -      "object"
      -    ]
      -  },
      -  "page": {
      -    "type": "string"
      -  },
      -  "paid_calls_30d": {
      -    "type": "integer"
      -  },
      -  "pay_to": {
      -    "type": "string"
      -  },
      -  "pay_to_sanctioned": {
      -    "type": "boolean"
      -  },
      -  "pay_to_shared_by_hosts": {
      -    "type": "integer"
      -  },
      -  "price": {
      -    "type": "string"
      -  },
      -  "protocol": {
      -    "type": "string"
      -  },
      -  "server": {
      -    "type": "string"
      -  },
      -  "server_instructions": {
      -    "additionalProperties": false,
      -    "properties": {
      -      "changed_at": {
      -        "type": "string"
      -      },
      -      "chars": {
      -        "type": "integer"
      -      },
      -      "injection_flags": {
      -        "items": {
      -          "type": "string"
      -        },
      -        "type": [
      -          "null",
      -          "array"
      -        ]
      -      },
      -      "sha256": {
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "sha256",
      -      "chars"
      -    ],
      -    "type": [
      -      "null",
      -      "object"
      -    ]
      -  },
      -  "source": {
      -    "type": "string"
      -  },
      -  "status": {
      -    "type": "string"
      -  },
      -  "testnet": {
      -    "type": "boolean"
      -  },
      -  "tool_description_flags": {
      -    "items": {
      -      "type": "string"
      -    },
      -    "type": [
      -      "null",
      -      "array"
      -    ]
      -  },
      -  "tools": {
      -    "type": "integer"
      -  },
      -  "tools_changed_at": {
      -    "type": "string"
      -  },
      -  "tools_diff": {
      -    "type": "string"
      -  },
      -  "trust_formula": {
      -    "type": "string"
      -  },
      -  "trust_score": {
      -    "type": [
      -      "null",
      -      "integer"
      -    ]
      -  },
      -  "unique_payers_30d": {
      -    "type": "integer"
      -  },
      -  "untrusted_fields": {
      -    "type": "string"
      -  },
      -  "uptime_24h_pct": {
      -    "type": "number"
      -  },
      -  "uptime_30d_pct": {
      -    "type": [
      -      "null",
      -      "number"
      -    ]
      -  },
      -  "uptime_7d_pct": {
      -    "type": "number"
      -  },
      -  "url": {
      -    "type": "string"
      -  },
      -  "verified_owner": {
      -    "type": "boolean"
      -  },
      -  "verified_purchases_30d": {
      -    "additionalProperties": false,
      -    "properties": {
      -      "delivered": {
      -        "type": "integer"
      -      },
      -      "delivered_payers": {
      -        "type": "integer"
      -      },
      -      "failed": {
      -        "type": "integer"
      -      },
      -      "failed_payers": {
      -        "type": "integer"
      -      },
      -      "partial": {
      -        "type": "integer"
      -      },
      -      "reports": {
      -        "type": "integer"
      -      }
      -    },
      -    "required": [
      -      "reports",
      -      "delivered",
      -      "partial",
      -      "failed",
      -      "delivered_payers",
      -      "failed_payers"
      -    ],
      -    "type": [
      -      "null",
      -      "object"
      -    ]
      -  }
      -}
    • removedOutput schema / properties / service / required
      Removed value: -[
      -  "id",
      -  "protocol",
      -  "url",
      -  "host",
      -  "name",
      -  "status",
      -  "advice",
      -  "alive",
      -  "uptime_24h_pct",
      -  "uptime_7d_pct",
      -  "checks_7d",
      -  "verified_owner",
      -  "trust_score",
      -  "trust_formula",
      -  "page",
      -  "source",
      -  "untrusted_fields"
      -]
  2. Changed1 schema field changed
    • addedOutput schema / properties / service / properties / server_instructions
      Added value: +{
      +  "additionalProperties": false,
      +  "properties": {
      +    "changed_at": {
      +      "type": "string"
      +    },
      +    "chars": {
      +      "type": "integer"
      +    },
      +    "injection_flags": {
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": [
      +        "null",
      +        "array"
      +      ]
      +    },
      +    "sha256": {
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "sha256",
      +    "chars"
      +  ],
      +  "type": [
      +    "null",
      +    "object"
      +  ]
      +}
  3. Changed1 schema field changed
    • addedOutput schema / properties / service / properties / onchain_payers_30d
      Added value: +{
      +  "additionalProperties": false,
      +  "properties": {
      +    "distinct_payers": {
      +      "type": "integer"
      +    },
      +    "network": {
      +      "type": "string"
      +    },
      +    "note": {
      +      "type": "string"
      +    },
      +    "payments": {
      +      "type": "integer"
      +    },
      +    "repeat_payers": {
      +      "type": "integer"
      +    },
      +    "since": {
      +      "type": "string"
      +    },
      +    "top_payer_share": {
      +      "type": "number"
      +    },
      +    "usd": {
      +      "type": "number"
      +    }
      +  },
      +  "required": [
      +    "payments",
      +    "distinct_payers",
      +    "repeat_payers",
      +    "top_payer_share",
      +    "usd",
      +    "network",
      +    "since",
      +    "note"
      +  ],
      +  "type": [
      +    "null",
      +    "object"
      +  ]
      +}
  4. Changed1 schema field changed
    • addedOutput schema / properties / service / properties / last_alive_at
      Added value: +{
      +  "type": "string"
      +}
  5. Changed3 schema fields changed
    • addedOutput schema / properties / service / properties / host_listings
      Added value: +{
      +  "type": "integer"
      +}
    • addedOutput schema / properties / service / properties / pay_to_shared_by_hosts
      Added value: +{
      +  "type": "integer"
      +}
    • addedOutput schema / properties / service / properties / uptime_30d_pct
      Added value: +{
      +  "type": [
      +    "null",
      +    "number"
      +  ]
      +}
  6. Changed2 schema fields changed
    • addedInput schema / properties / client
      Added value: +{
      +  "description": "optional: your x402 client library and version, e.g. @x402/fetch@2.22.1 or pypi:x402@2.19.0; alalanet warns about versions with known payment flaws (not logged)",
      +  "type": "string"
      +}
    • addedOutput schema / properties / client_advisories
      Added value: +{
      +  "items": {
      +    "additionalProperties": false,
      +    "properties": {
      +      "below": {
      +        "type": "string"
      +      },
      +      "fixed_in": {
      +        "type": "string"
      +      },
      +      "from": {
      +        "type": "string"
      +      },
      +      "id": {
      +        "type": "string"
      +      },
      +      "package": {
      +        "type": "string"
      +      },
      +      "published": {
      +        "type": "string"
      +      },
      +      "severity": {
      +        "type": "string"
      +      },
      +      "source": {
      +        "type": "string"
      +      },
      +      "summary": {
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "id",
      +      "package",
      +      "below",
      +      "severity",
      +      "summary",
      +      "fixed_in",
      +      "source",
      +      "published"
      +    ],
      +    "type": "object"
      +  },
      +  "type": [
      +    "null",
      +    "array"
      +  ]
      +}
  7. Changed1 schema field changed
    • addedOutput schema / properties / service / properties / alalanet_test_purchase
      Added value: +{
      +  "additionalProperties": false,
      +  "properties": {
      +    "at": {
      +      "type": "string"
      +    },
      +    "bytes": {
      +      "type": "integer"
      +    },
      +    "http_status": {
      +      "type": "integer"
      +    },
      +    "note": {
      +      "type": "string"
      +    },
      +    "outcome": {
      +      "type": "string"
      +    },
      +    "response_sha256": {
      +      "type": "string"
      +    },
      +    "tx": {
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "at",
      +    "outcome",
      +    "http_status",
      +    "bytes",
      +    "tx",
      +    "note"
      +  ],
      +  "type": [
      +    "null",
      +    "object"
      +  ]
      +}
  8. First observed

TDQS

A4.5/5.0
Behavior5/5

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

Goes well past the annotations, which only declare readOnly/openWorld/non-idempotent. It discloses that the decision is bound to the payment hash, valid up to 5 minutes via expires_at, signed and logged, plus the exception where an unlisted url resembling a key/token yields a private, unattested decision. That exception detail is exactly the kind of consequence an agent cannot infer from structured fields.

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?

Purpose is front-loaded and the allow/hold/block gloss at the end is genuinely clarifying. However, the long inline glossary of roughly thirty reason codes duplicates what an output schema already carries, and the closing restatement of allow/hold/block partially repeats it, padding an otherwise tight definition.

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

Completeness5/5

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

Read-only annotations, a full output schema, and four fully documented parameters mean the remaining burden is decision semantics — which the description covers via verdict categories, reason-code taxonomy, expiry, logging, and the unattested edge case. Nothing an agent needs to call this correctly is missing.

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 baseline is 3; the description still adds real meaning by explaining that client advisories surface as client_advisories and are not logged, and that omitting payment_required falls back to last-observed terms. Those are non-obvious consequences of parameter choice rather than restatements.

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?

First sentence names a specific verb and resource with precise timing scope: 'Decision for one x402 payment, right before it is signed.' That is distinguishable from siblings like check_service (service liveness) or payment_status (post-hoc lookup) without opening any schema.

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?

Timing is explicit ('right before it is signed') and required vs optional inputs are spelled out (url plus the 402 it returned; max_usd and client optional). It also states the omit-payment_required fallback ('judge the terms alalanet last observed'). It stops short of naming sibling alternatives such as check_service or payment_status, so it is clear context but not full when/when-not routing.

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