Skip to main content
Glama

SpendGate

Score a planned spend

score_spend

Score one planned payment before it is sent: a crypto transfer, gift card, subscription, or paid API or merchant. Do not use it for a pure read, or for a status_check under $1 you will not pay; that still burns a free score and approves unless a budget you pass is exceeded. Each call uses one free score (anonymous 100/UTC day, sg_live_ key 1,000 from get_api_key). Past that cap the call is HTTP 402 and costs 0.001 USDC on Base via x402. It does not pay the merchant. A domain, https URL, or 0x payee that is not on the local known-host list is checked with PayCheck. Trusted counts as a known merchant. Block means do not pay, including under the micro threshold. If PayCheck is unreachable, local merchant rules are used and the score still returns. While free quota remains, the same arguments consume another score. category overrides purpose. When category is omitted, purpose is matched as a category name; any other prose is unknown risk. merchant overrides endpoint when both are set. A set daily_budget_remaining or monthly_budget_remaining blocks when amount is greater; omitted budgets are skipped. Returns score 0-100, verdict approve|ask_human|block, reasons, recommended_action, checked_at, detail, and quota (daily_limit, used_today, remaining_today, paid_today, resets_at). approve means pay; ask_human means stop for a person; block means do not pay. Read the cap with get_quota instead of spending a score.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
amountYesPlanned spend in USD, not token atomic units. Required.
api_keyNoOptional sg_live_ key. Uses the 1,000/day bucket. An unrecognized key returns invalid_api_key instead of falling back to anonymous.
purposeNoShort note, max 280 characters. When category is omitted, this text is matched as a category name; other prose is unknown risk. When category is set, this is echoed and not scored.
agent_idNoAgent or key id. Echoed, not scored in v1.
categoryNoRisk class. Wins over purpose. One of status_check, api_call, saas, infra, gift_card, crypto_transfer, irreversible. Any other string is unknown risk.
currencyNoPayment currency. Defaults to USDC.
endpointNoPayee used only when merchant is omitted. Ignored if merchant is also set.
merchantNoPayee name or https URL. Used instead of endpoint when both are set. A missing payee is penalized.
risk_hintsNoSelf-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_remainingNoUSD left today. When set, a greater amount is blocked. Omit to skip this check.
monthly_budget_remainingNoUSD left this month. When set, a greater amount is blocked. Omit to skip this check.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed9 schema fields changed
    • changedInput schema / properties / agent_id / description
      Previous value: -"Your agent or key id. Echoed, not scored in v1."New value: +"Agent or key id. Echoed, not scored in v1."
    • changedInput schema / properties / amount / description
      Previous value: -"Planned spend in USD, not in token atomic units."New value: +"Planned spend in USD, not token atomic units. Required."
    • changedInput schema / properties / api_key / description
      Previous value: -"Optional SpendGate key (sg_live_…). Anonymous callers share a smaller daily cap."New value: +"Optional sg_live_ key. Uses the 1,000/day bucket. An unrecognized key returns invalid_api_key instead of falling back to anonymous."
    • changedInput schema / properties / category / description
      Previous value: -"One of status_check, api_call, saas, infra, gift_card, crypto_transfer, irreversible. Unknown categories are scored as unknown risk."New value: +"Risk class. Wins over purpose. One of status_check, api_call, saas, infra, gift_card, crypto_transfer, irreversible. Any other string is unknown risk."
    • changedInput schema / properties / daily_budget_remaining / description
      Previous value: -"USD still available today. Amount above this is blocked."New value: +"USD left today. When set, a greater amount is blocked. Omit to skip this check."
    • changedInput schema / properties / endpoint / description
      Previous value: -"Alias of merchant when the payee is an API URL."New value: +"Payee used only when merchant is omitted. Ignored if merchant is also set."
    • changedInput schema / properties / merchant / description
      Previous value: -"Merchant name or https endpoint URL that will receive the spend."New value: +"Payee name or https URL. Used instead of endpoint when both are set. A missing payee is penalized."
    • changedInput schema / properties / monthly_budget_remaining / description
      Previous value: -"USD still available this month. Amount above this is blocked."New value: +"USD left this month. When set, a greater amount is blocked. Omit to skip this check."
    • changedInput schema / properties / purpose / description
      Previous value: -"Short human description. Used as the category when category is omitted."New value: +"Short note, max 280 characters. When category is omitted, this text is matched as a category name; other prose is unknown risk. When category is set, this is echoed and not scored."
  2. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Annotations only give the safety profile (not read-only, not destructive, not idempotent); the description adds quota accounting (100/UTC-day anonymous, 1,000 with sg_live_), the 402 + 0.001 USDC x402 charge after cap, that it does not pay the merchant, PayCheck lookup with local-rule fallback, budget-blocking behavior, and the warning that identical arguments still consume another score. Minor tension: an external PayCheck lookup sits awkwardly with openWorldHint=false, but it is a bounded risk service rather than open-ended world interaction.

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

Conciseness4/5

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

Roughly 1,300 characters, but front-loaded with purpose and exclusions, then cost/quota, then behavioral rules, then parameter precedence, then the return contract. Slight redundancy in restating verdict semantics ('block means do not pay' appears twice), which keeps it just short of 5.

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?

There is no output schema, yet the description enumerates the entire return payload (score 0-100, verdict, reasons, recommended_action, checked_at, detail, quota fields) and defines approve/ask_human/block. For an 11-parameter scoring tool, nothing an agent needs to call or interpret it is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the baseline is 3. Every parameter claim in the description (category overrides purpose, merchant overrides endpoint, budgets block when amount is greater, unknown prose is unknown risk) is already stated in the corresponding schema descriptions, so the description adds no meaning beyond the schema.

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 a specific verb+resource ('Score one planned payment before it is sent') and enumerates the covered spend types (crypto transfer, gift card, subscription, paid API or merchant). It also distinguishes itself from the sibling get_quota and implicitly from get_api_key by telling the agent not to call it just to read the cap.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicit when-not guidance ('Do not use it for a pure read, or for a status_check under $1 you will not pay') and a named alternative ('Read the cap with get_quota instead of spending a score'). It also supplies the cost consequence that governs the use/no-use decision, which is exactly what an agent needs to route correctly.

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.