Skip to main content
Glama

PayStage — x402 payment safety and spend policy

validate_policy

Read-only

spending limits. Call this before wiring a policy into anything: a policy that fails validation makes every evaluation refuse, which looks like a product bug and is not one. Returns valid: true, or the exact field and message that is wrong. No payment needed, no network call, no key. Use it in CI on the policy file your agent ships with.

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": {
      "policy": "<policy>"
    },
    "name": "validate_policy"
  }
}

Input Schema

NameRequiredDescriptionDefault
policyYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.6/5.0
Behavior4/5

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

Annotations already cover read-only, non-destructive, and closed-world behavior, so the description only needs to add context. It does: no payment, no network call, no key, plus the success/failure return shape and the failure consequence ('every evaluation refuse'). That is meaningful added context beyond the structured fields.

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?

Three dense sentences, each adding distinct information, with the failure-consequence rationale placed early. The dangling 'spending limits.' fragment at the start is wasted space and makes the opening read as truncated rather than front-loaded.

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?

It compensates well for the missing output schema by stating the exact return shape ('valid: true, or the exact field and message that is wrong'). However, for a single-argument tool whose schema is a bare untyped object, the description leaves the input format unresolved, which is a real completeness gap.

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?

The schema is an empty object for 'policy' with 0% description coverage, so the description carries the full burden. It says 'the policy file your agent ships with', which hints at a file or path but never resolves whether the argument is a path string, raw JSON text, or an inline policy object. That ambiguity is exactly the thing an agent needs resolved before calling.

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?

The description conveys that this checks a spending policy and reports failure, but the opening fragment 'spending limits.' is not a clean verb+resource statement and the tool's actual name is never restated as an action. The line about 'a policy that fails validation makes every evaluation refuse' indirectly separates it from the evaluate_* siblings, so an agent can still place it correctly.

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?

It gives an explicit precondition ('Call this before wiring a policy into anything') and a concrete workflow ('Use it in CI on the policy file your agent ships with'), which is stronger than most. It stops short of naming a specific alternative or a when-not condition, so it is not fully exhaustive.

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.