Skip to main content
Glama

x402 Agent Toolkit — Quant Arb, TWSE & Agent Security

x402_preflight

[$0.005 USDC via x402] Before your AI agent pays an unknown x402 URL, audit it: checks latency, HTTP 402 compliance, decodes PAYMENT-REQUIRED, verifies official USDC contract & valid payTo address, checks Bazaar schema, and returns a 0-100 trust score.

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": {
      "url": "<url>"
    },
    "name": "x402_preflight"
  }
}

Input Schema

NameRequiredDescriptionDefault
urlYesTarget x402 endpoint URL to preflight-audit.
methodNoGET

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.9/5.0
Behavior4/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 well: it discloses the cost ($0.005 USDC via x402), the read-only nature of the operation, the individual audit steps, and that the output is a 0-100 trust score. Gaps remain around failure modes (timeout, unreachable URL, non-compliant 402) and what a partial/thresholded score means.

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?

A single dense sentence with a front-loaded cost banner and the trigger condition placed before the checklist, so the reader gets cost plus purpose immediately. Every clause adds information, though the list of checks is packed tight enough that it reads as a run-on.

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?

For a two-parameter audit tool with no output schema, the description covers what is inspected and the shape of the result (0-100 trust score). It stops short of explaining score thresholds, timeout behavior, or per-check result detail, which an agent would need to interpret the response.

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 coverage is 50%: the url parameter is already documented in the schema and the description adds only the phrase 'unknown x402 URL' as context. The method parameter (GET/POST enum with a GET default) is never mentioned in the description, so its purpose is inferred purely from the enum name.

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 gives a specific verb (audit/preflight) and resource (an unknown x402 URL), and enumerates the concrete checks performed (latency, HTTP 402 compliance, PAYMENT-REQUIRED decoding, USDC contract/payTo verification, Bazaar schema). It implicitly separates itself from general fetchers like safe_fetch by scoping to pre-payment x402 validation, but never names an alternative explicitly.

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?

"Before your AI agent pays an unknown x402 URL, audit it" states a clear trigger condition and temporal ordering. There is no explicit when-not guidance (e.g., skip for already-trusted endpoints or for non-x402 URLs), leaving that boundary to inference.

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.