Skip to main content
Glama

PayStage — x402 payment safety and spend policy

evaluate_batch

Read-only

transaction scope. Call this when an agent might pay several times in one turn and you want one policy decision covering all of them. Verdict is pay | review | do_not_pay per item, in input order, with reason codes — so the agent can stop at the first refusal rather than discovering it after three payments. Read-only, holds no keys, never signs. Cheaper and more consistent than calling evaluate_mcp_payment in a loop: same policy, one round trip.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "payments": "<payments>",
      "policy": "<policy>"
    },
    "name": "evaluate_batch"
  }
}

Input Schema

NameRequiredDescriptionDefault
policyYes
paymentsYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false, so safety is largely covered; the description adds specific custody guarantees (holds no keys, never signs) plus output behavior: verdict tokens, input-order results, reason codes, and first-refusal semantics that let the agent stop early. Those additions are real, though "read-only" restates the annotation.

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?

Mostly dense and front-loaded, with the routing advice and the refusal-early rationale each earning their sentence. The opening fragment "transaction scope." is a dangling phrase that costs clarity without adding information.

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

Completeness3/5

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

With no output schema, the description correctly explains the return vocabulary and ordering, which an agent needs. But for a tool whose arguments are entirely undocumented, omitting any account of the policy or payment item structure leaves a material gap before the tool can be invoked correctly.

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

Parameters2/5

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

Schema coverage is 0% — both payments and policy are bare `{}` with no item shape, no enum, no constraints. The description explains the verdict vocabulary but says nothing about what a policy object must contain or what fields a payment item requires, and the 1–50 maxItems bound goes unmentioned. It does not compensate for the empty 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?

The description states a specific function: evaluating a batch of payments as one policy decision, with a verdict of pay | review | do_not_pay per item. It explicitly distinguishes itself from evaluate_mcp_payment called in a loop, so an agent can identify its role without opening the schema.

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?

It names the trigger condition precisely ("when an agent might pay several times in one turn") and the alternative (calling evaluate_mcp_payment in a loop), along with why this tool wins (cheaper, more consistent, one round trip). Selection between the two 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.