Score a planned spend before an agent pays
score_spendScore one planned payment and return approve, ask_human, or block before any tool sends money. Use before a crypto transfer, gift card, subscription, or paid API call. Do not use it for uptime (check_mcp_server_health, check_api_status), to judge whether a host or wallet is trusted (check_merchant), or to read remaining free scores (get_quota). Does not transfer funds. Returns score 0-100, verdict (approve means pay, ask_human means stop and ask a person, block means do not pay), reasons, and recommended_action. Scoring is deterministic, so rewording purpose will not change the verdict. amount is USD, not token units. api_key, when set, is a SpendGate sg_live_ key, not a Toolweather tw_ key from get_api_key. Uses SpendGate's quota (100/day anonymous, 1,000/day with an sg_live_ key), then $0.001 via x402, not the Toolweather check quota.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| amount | Yes | Planned spend in USD, not in token atomic units. Compared with daily_budget_remaining and monthly_budget_remaining when those are set. | |
| api_key | No | Optional SpendGate key (sg_live_…). Not a Toolweather tw_ key; that key belongs in the X-API-Key header. Omit to use the anonymous IP/session cap, which can reset on rotating egress. | |
| purpose | No | Short human description. Used as the category when category is omitted. Rewording it does not change a v1 verdict. | |
| agent_id | No | Your agent or key id. Echoed back, not scored in v1. | |
| category | No | One of status_check, api_call, saas, infra, gift_card, crypto_transfer, irreversible. Unknown categories are scored as unknown risk, not rejected. | |
| currency | No | Payment currency. Defaults to USDC. Does not convert amount; amount stays in USD. | |
| endpoint | No | Alias of merchant when the payee is an API URL. Pass one of them, not both for different payees. | |
| merchant | No | Merchant name or https endpoint URL that would receive the spend. The call does not pay this URL. | |
| risk_hints | No | Self-reported hints. Raising: new_payee, new_merchant, first_payment, high_velocity, mismatched_purpose, off_platform, shared_wallet. Lowering: trusted_repeat, within_policy, human_preapproved. known_merchant marks the payee known. | |
| daily_budget_remaining | No | USD still available today. Amount above this is blocked. Omit if you have no daily cap to enforce. | |
| monthly_budget_remaining | No | USD still available this month. Amount above this is blocked. Omit if you have no monthly cap. |