Skip to main content
Glama

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
X402_DEFAULT_MAX_TX_USDC_ATOMICNoDefault per-transaction spend ceiling in USDC atomic units (minor units), e.g. "5000000". Enforced by the integer-only SPEC_CLASS_09 spend gate.5000000

Instructions

Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.

Zero-dependency x402 HTTP 402 & A2A AP2 payment guard: inspect CAIP-2 payment headers, enforce SPEC_CLASS_09 integer minor-unit spend caps & SQLite WAL nonces, verify Ed25519 + RFC 8785 JCS AP2 CartMandates, scaffold S4-REJECT-005-safe signed A2A v1.0.1 AgentCards, convert exact atomic units, and verify settlement webhooks.

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

CapabilityDetails
tools
{
  "listChanged": false
}
prompts
{
  "listChanged": false
}
resources
{
  "subscribe": false,
  "listChanged": false
}

Tools

Functions exposed to the LLM to take actions

NameDescription
x402_inspect_payment_headerA

Parse & audit HTTP 402 PAYMENT-REQUIRED, X-PAYMENT, and PAYMENT-SIGNATURE headers (JSON, base64, or base64url JSON) across CAIP-2 networks (eip155:8453 Base USDC EIP-3009 TransferWithAuthorization, eip155:84532 Base Sepolia, solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp, stacks:1 sBTC). Flags IEEE-754 floats, zero/negative atomic amounts, expired validBefore, future validAfter, untrusted asset contracts, and payee mismatch.

x402_enforce_spend_policyA

Deterministic SPEC_CLASS_09 spend-cap & integer fee-math gate (net_minor = amount_minor * (10000 - fee_bps) // 10000, strictly rejecting IEEE-754 floats and slippage_bps < 0). Enforces max_per_tx_minor, cumulative_spent_minor + amount_minor <= daily_cap_minor, allowed_payees, allowed_caip2_networks, and idempotency_nonce replay rejection (stateless batch or optional thread-safe SQLite WAL ledger).

ap2_verify_cart_mandateA

Verify A2A AP2 (Agent Payments Protocol) IntentMandate & CartMandate envelopes: validates line-item integer minor-unit sum == total_amount_minor, ISO-4217 & crypto currency exponents (0 JPY/VND, 2 USD/EUR, 3 KWD, 6 USDC, 8 sBTC, 9 SOL, 18 WEI), payee_id binding, TTL expiry, human_confirmation_threshold_minor, and pure-Python RFC 8032 Ed25519 + RFC 8785 JCS signatures.

x402_scaffold_agent_card_extensionB

Generate spec-compliant HTTP 402 PAYMENT-REQUIRED JSON/base64 headers and a strict S4-REJECT-005-safe A2A v1.0.1 /.well-known/agent-card.json + /.well-known/jwks.json bundle with x402 & AP2 extensions signed in pure Python (RFC 8032 Ed25519 + RFC 8785 JCS) without breaking ProtoJSON JWS verification.

x402_convert_atomic_unitsA

Exact Decimal string <-> integer minor/atomic unit converter (USD 2, EUR 2, VND 0, JPY 0, KWD 3, USDC 6, sBTC 8, SOL 9, WEI 18) with explicit SUB_ATOMIC_DUST_REJECTED rounding rejection whenever fractional sub-atomic dust is supplied.

x402_verify_settlement_webhookA

Verify x402 / facilitator settlement webhooks via constant-time hmac.compare_digest (HMAC-SHA256) or pure-Python RFC 8032 Ed25519, enforcing timestamp skew limits, mandatory idempotency_key deduplication (SPEC_CLASS_14), integer settlement math (SPEC_CLASS_09), and automatic redaction of accidental API keys, secrets, and payment card digits.

Prompts

Interactive templates invoked by user choice

NameDescription
audit-402-payment-challengeDecode an HTTP 402 `PAYMENT-REQUIRED` or `X-PAYMENT` header, verify CAIP-2 asset authenticity and EIP-3009 time bounds, and evaluate spend-cap policy before signing.
verify-ap2-cart-mandateVerify an A2A AP2 `CartMandate` or `IntentMandate` envelope across ISO-4217/crypto minor-unit exponents, line-item sum conservation, human-confirmation threshold, and Ed25519 JCS signatures.
add-x402-pricing-to-agent-cardScaffold HTTP 402 `PAYMENT-REQUIRED` headers and an `S4-REJECT-005`-compliant Ed25519-signed A2A v1.0.1 `/.well-known/agent-card.json` + `jwks.json` bundle.

Resources

Contextual data attached and managed by the client

NameDescription
CAIP-2 Canonical x402 Asset Contracts & Currency Minor-Unit ExponentsCanonical contract/mint addresses for Base USDC (`eip155:8453`), Base Sepolia (`eip155:84532`), Solana USDC/SOL, Stacks sBTC (`stacks:1`), and exact `0/2/3/6/8/9/18` decimal exponents.
SPEC_CLASS_09 & SPEC_CLASS_14 Agentic Payment Security InvariantsEngineering checklist covering integer-only minor-unit math, EIP-3009 replay bounds, AP2 Ed25519 + RFC 8785 JCS mandates, S4-REJECT-005 ProtoJSON safety, and webhook DLP hygiene.

TDQS

A3.8/5.0

Scored across 6 tools

Disambiguation4/5

Each tool targets a distinct phase of the payment lifecycle: policy enforcement, header parsing, mandate verification, artifact scaffolding, unit conversion, and webhook verification. Only minor overlap exists between x402_enforce_spend_policy and ap2_verify_cart_mandate, since both validate amounts, payees, and thresholds, but their inputs (transactions vs. mandate envelopes) are clearly separated.

Naming Consistency4/5

All six names follow a verb_noun pattern (enforce_spend_policy, inspect_payment_header, convert_atomic_units, etc.), so they are predictable and readable. The only deviation is the ap2_ prefix on ap2_verify_cart_mandate versus x402_ elsewhere, though this usefully signals the protocol family the tool handles.

Tool Count5/5

Six tools is well-scoped for a focused x402/AP2 guard server, and each maps to a distinct responsibility (enforce, inspect, verify mandates, scaffold, convert, verify webhooks). No tool appears redundant or vestigial.

Completeness4/5

The surface covers the core guard workflow: policy enforcement, header audit, mandate verification, artifact generation, unit math, and webhook verification. Minor gaps remain: there is no payer-side X-PAYMENT payload construction or signing tool, and no way to query or reset the cumulative spend ledger that x402_enforce_spend_policy maintains, but agents can work around these with the scaffolding and enforcement tools.

Maintenance

ActivityMaintained
ResponsivenessNo recent community issues