Skip to main content
Glama

Pre-payment spend check

spend_check

0.005 USDC per call via x402, no key (unpaid call returns PaymentRequired; retry with params.meta["x402/payment"]). Advisory pre-sign check (your wallet's own hard limits still apply; we cannot block a payment): 'would this payment exceed my cap?'. Pass the 402 PAYMENT-REQUIRED (header or body) or amountUsd, plus payer and optional sessionId/host. Returns allow|deny with reasons and remaining budget; reserve:true also logs it as pending. Needs a key mts (X-API-Key header or apiKey argument). No key? call settle_trial_key (free, 50 calls/7 days). Full plan 1 USDC/30d incl. 1,000 calls via x402.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "spend_check"
  }
}

Input Schema

NameRequiredDescriptionDefault
refNoYour order / request id (idempotency key).
hostNoSeller hostname, e.g. api.example.com.
payToNoSeller receiving address 0x….
payerNoPayer / agent wallet address 0x… (40 hex).
apiKeyNoYour MoneyTools Settle key mts_… (alternative to the X-API-Key header). No key: call settle_trial_key.
networkNoCAIP-2 network, default eip155:8453 (Base).
reserveNotrue = log this payment as pending if allowed.
amountUsdNoUSD amount as decimal string, e.g. "0.25".
sessionIdNoYour session / run id.
paymentRequiredNoThe 402 PAYMENT-REQUIRED header (base64) or the 402 JSON body.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.5/5.0
Behavior5/5

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

Goes well beyond the annotations: discloses the x402 paywall flow (unpaid call returns PaymentRequired, retry with params._meta['x402/payment']), the advisory limitation, that reserve:true creates a pending log entry, the auth requirement (mts_ key via header or argument), and pricing. This is consistent with readOnlyHint=false and destructiveHint=false (a side effect exists but is non-destructive).

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?

Dense but cluttered: it leads with per-call price and plan pricing rather than the purpose, and packs paywall, trial-key upsell, and subscription details into parentheticals. Every fact is relevant, but the ordering and nesting make it slower to parse than it needs to be.

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?

For a 10-parameter, zero-required-parameter tool with no output schema, the description covers cost, auth, input alternatives, the 402 retry path, and the exact return shape (allow|deny plus reasons and remaining budget). Nothing an agent needs in order to invoke it 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, but the description adds real routing meaning: pass either the 402 PAYMENT-REQUIRED (header or body) or amountUsd, along with payer and optional sessionId/host, and explains reserve:true. That alternative-input guidance is not evident from the schema alone.

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 the verb and resource precisely: an 'advisory pre-sign check' answering the literal question 'would this payment exceed my cap?'. The contrast with the wallet's own hard limits and the explicit allow|deny output make it distinguishable from cap-management siblings such as spend_cap_get/spend_cap_set.

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?

Makes clear this is called before signing a payment, that it is advisory only and cannot block anything, and routes keyless callers to settle_trial_key. It does not explicitly contrast with spend_cap_get or spend_log, but the when-to-use condition is unambiguous.

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