Skip to main content
Glama

Agent Decision & Evidence Tools (MCP + x402)

Prepare x402 Purchase Guard (free)

prepare_x402_purchase_guard
Read-onlyIdempotent

FREE strict syntax and supported-v2-shape check for a raw base64/base64url PAYMENT-REQUIRED header. Returns a canonical challenge fingerprint and the policy fields required by the paid guard, without revealing the paid decision, contacting the target, reading a wallet or attempting payment.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
payment_requiredYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
toolNo
errorNo
priceNoNo payment is required for this tool.
chargedNo
messageNo
missingNo
settledNoWhen present on an error, false means no settlement occurred.
unknownNo
acceptedNo
contractNo
paid_toolNo
retryableNo
error_codeNo
status_codeNo
did_you_meanNo
ready_to_buyNo
missing_checksNo
required_policyNo
wallet_accessedNo
challenge_sha256No
partial_evidenceNo
challenge_hash_basisNo
target_network_calledNo
ready_for_paid_analysisNo
target_payment_attemptedNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changed
    • addedInput schema / additionalProperties
      Added value: +false
    • addedInput schema / properties / payment_required / maxLength
      Added value: +65536
    • addedInput schema / properties / payment_required / minLength
      Added value: +1
    • removedInput schema / properties / payment_required / title
      Removed value: -"Payment Required"
    • removedInput schema / title
      Removed value: -"prepare_x402_purchase_guard_toolArguments"
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": true,
      +  "anyOf": [
      +    {
      +      "required": [
      +        "contract",
      +        "ready_to_buy",
      +        "ready_for_paid_analysis",
      +        "charged",
      +        "challenge_sha256",
      +        "challenge_hash_basis",
      +        "paid_tool",
      +        "required_policy",
      +        "target_network_called",
      +        "wallet_accessed",
      +        "target_payment_attempted",
      +        "price"
      +      ]
      +    },
      +    {
      +      "required": [
      +        "error"
      +      ]
      +    }
      +  ],
      +  "description": "Structured result contract for prepare_x402_purchase_guard. A success satisfies the documented success branch. A domain or tool error includes error and is not a successful settlement; unpaid x402 requirements are carried by the transport wrapper.",
      +  "properties": {
      +    "accepted": {
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    "challenge_hash_basis": {
      +      "type": "string"
      +    },
      +    "challenge_sha256": {
      +      "type": "string"
      +    },
      +    "charged": {
      +      "type": "boolean"
      +    },
      +    "contract": {
      +      "type": "string"
      +    },
      +    "did_you_mean": {
      +      "additionalProperties": true,
      +      "type": [
      +        "object",
      +        "null"
      +      ]
      +    },
      +    "error": {
      +      "oneOf": [
      +        {
      +          "type": "string"
      +        },
      +        {
      +          "additionalProperties": true,
      +          "properties": {
      +            "code": {
      +              "type": [
      +                "string",
      +                "null"
      +              ]
      +            },
      +            "message": {
      +              "type": "string"
      +            },
      +            "param": {
      +              "type": [
      +                "string",
      +                "null"
      +              ]
      +            },
      +            "type": {
      +              "type": "string"
      +            }
      +          },
      +          "required": [
      +            "message"
      +          ],
      +          "type": "object"
      +        }
      +      ]
      +    },
      +    "error_code": {
      +      "type": "string"
      +    },
      +    "message": {
      +      "type": "string"
      +    },
      +    "missing": {
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    "missing_checks": {
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    "paid_tool": {
      +      "type": "string"
      +    },
      +    "partial_evidence": {
      +      "additionalProperties": true,
      +      "type": "object"
      +    },
      +    "price": {
      +      "const": "free",
      +      "description": "No payment is required for this tool.",
      +      "type": "string"
      +    },
      +    "ready_for_paid_analysis": {
      +      "type": "boolean"
      +    },
      +    "ready_to_buy": {
      +      "type": "boolean"
      +    },
      +    "required_policy": {
      +      "items": {},
      +      "type": "array"
      +    },
      +    "retryable": {
      +      "type": "boolean"
      +    },
      +    "settled": {
      +      "description": "When present on an error, false means no settlement occurred.",
      +      "type": "boolean"
      +    },
      +    "status_code": {
      +      "type": "integer"
      +    },
      +    "target_network_called": {
      +      "type": "boolean"
      +    },
      +    "target_payment_attempted": {
      +      "type": "boolean"
      +    },
      +    "tool": {
      +      "type": "string"
      +    },
      +    "unknown": {
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    "wallet_accessed": {
      +      "type": "boolean"
      +    }
      +  },
      +  "type": "object"
      +}
  2. Added

TDQS

A4.7/5.0
Behavior5/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, and destructiveHint=false, and the description adds meaningful behavioral context beyond that: it is free, performs only strict syntax/shape validation, returns a canonical fingerprint and policy fields, and explicitly does not contact the target, read a wallet, or attempt payment. This gives the agent a clear safety and side-effect profile.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single dense sentence communicates the tool's purpose, scope, limitations, and outputs without redundancy. Every clause earns its place, and the most important qualifier ('FREE') is front-loaded.

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?

With only one parameter, a rich output schema, and annotations covering safety and idempotency, the description is complete for correct invocation. It also clarifies the relationship to the paid guard and lists key behavioral boundaries, leaving no critical gap for an agent deciding whether to call this tool.

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 description coverage is 0%, so the description must compensate. It does by specifying that 'payment_required' is the raw base64/base64url PAYMENT-REQUIRED header, which explains the expected format and meaning beyond the schema's bare string field. It stops short of detailing edge cases like expected header prefix handling, but for a single parameter this is adequate.

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?

The description clearly identifies a specific verb ('check'), a specific resource ('raw base64/base64url PAYMENT-REQUIRED header'), and the distinguishable scope ('FREE strict syntax and supported-v2-shape check'). It also differentiates itself from the paid guard by stating it does not reveal the paid decision, which is a clear separation from sibling x402_purchase_guard.

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?

The description implies when to use this tool: it produces 'the policy fields required by the paid guard,' so an agent can infer it is a preliminary/free preparation step. It also lists exclusions ('without contacting the target, reading a wallet or attempting payment'), but it does not explicitly state 'use this before x402_purchase_guard' or name exact alternative conditions.

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.