Skip to main content
Glama

check_payment_with_model

Reviews stablecoin or x402 payments before sending by running a local risk model over verification outputs, returning approve, hold, or reject and failing closed on errors.

Instructions

Full risk review of a stablecoin payment by the SRA-RiskGate-4B model.

Needs the model running locally (for example: ollama pull sriram1983007/sra-riskgate).
Arguments follow the model's training format:
  now_unix      current Unix time
  policy        the receiving policy (e.g. max_amount_usdc, trusted_attesters, allowed_assets)
  payload       the payment exactly as received (treated as untrusted)
  tool_results  outputs of real verification tools: decoded payment, signature check,
                risk attestations and sanctions screening

The model reasons over tool_results; it does not run those checks itself.
Returns decision (approve | hold | reject), risk_level, flags, explanation and
required_actions. If the model is unavailable or answers off-schema, returns "hold".
If the untrusted payload claims its own verification (for example "risk level: low
(verified offline)"), returns "hold" before the model is asked.
Only proceed if decision is "approve".

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
policyYesThe receiving policy, for example {"max_amount_usdc": 100, "allowed_assets": ["USDC"], "trusted_attesters": ["0x..."]}.
payloadYesThe payment exactly as received, including any memo or description. Treated as untrusted.
now_unixYesCurrent Unix time in seconds.
tool_resultsYesOutputs of your own verification tools: decoded payment, signature check, risk attestations and sanctions screening. The model reasons over these; it does not run them.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv0.3.1
    • addedInput schema / properties / now_unix / description
      Added value: +"Current Unix time in seconds."
    • addedInput schema / properties / payload / description
      Added value: +"The payment exactly as received, including any memo or description. Treated as untrusted."
    • addedInput schema / properties / policy / description
      Added value: +"The receiving policy, for example {\"max_amount_usdc\": 100, \"allowed_assets\": [\"USDC\"], \"trusted_attesters\": [\"0x...\"]}."
    • addedInput schema / properties / tool_results / description
      Added value: +"Outputs of your own verification tools: decoded payment, signature check, risk attestations and sanctions screening. The model reasons over these; it does not run them."
  2. First observedv0.1.0

TDQS

A3.9/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and does so well: it names the model dependency, the training-format arguments, the fallback to 'hold' on unavailability or off-schema output, and the prompt-injection guard that forces 'hold' before the model runs. These are non-obvious behavioral traits an agent cannot infer from the schema.

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?

Front-loads the purpose and key dependency, then uses an indented argument list. Every line is substantive, though the argument enumeration partially duplicates the schema and could be tighter.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Though an output schema exists and explains return values, the description adds essential context: the fallback behavior, the injection guard, and the required local model. Given the overt security sensitivity (untrusted payload, injection handling), a bit more on trust boundary or expected tool_results shape would help, but it is largely complete.

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 schema already documents all four parameters. The description restates the model's training-format argument names and semantics, adding marginal framing (payload treated as untrusted, tool_results are pre-run) but no syntax or format detail beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb (risk review), resource (stablecoin payment), and names the specific model doing the reasoning (SRA-RiskGate-4B). It is distinguishable from siblings like check_payment_rules and check_x402_payment by being explicitly model-based, though it doesn't directly contrast itself with them.

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

Usage Guidelines3/5

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

Gives a key gating instruction ('Only proceed if decision is approve') and a prerequisite (model must run locally), which is useful. However it never explicitly says when to use this versus the sibling tools check_payment_rules or check_x402_payment, leaving the primary routing decision to inference.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.