Skip to main content
Glama
x402-preflight-mcp

x402-preflight-mcp

by animus3d

mcp_tool_schema_validator

Audits MCP tool definitions for schema validity, token bloat, prompt injection, and missing bounds to catch unsafe or inefficient tools before agent use.

Instructions

[x402 $0.02 USDC on Base/Solana] Audits Model Context Protocol (MCP) tool definitions for schema validity, token bloat, description-poisoning / prompt injection, and missing bounds.

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": {
      "tools": "<tools>"
    },
    "name": "mcp_tool_schema_validator"
  }
}

Input Schema

NameRequiredDescriptionDefault
toolsYesArray of MCP tool definitions
_paymentSignatureNoOptional base64-encoded x402 v2 payment-signature header (overrides X402_PAYMENT_SIGNATURE env var).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

B3.2/5.0
Behavior2/5

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

No annotations are supplied, so the description carries the full behavioral burden. It does disclose the notable commercial trait (x402 payment of $0.02 USDC on Base/Solana), but says nothing about whether tool definitions are transmitted to a remote service, whether the call is read-only, what happens on unpaid calls, or how findings are returned for a tool with no output 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?

A single tightly-packed sentence with the pricing bracket front-loaded and zero filler. Dense but readable, and it puts cost before capability, which is the right priority for a paid call.

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?

The tool is simple (2 params, no nesting), and the description covers what is inspected, but with no output schema present the description should say what an audit returns (findings list, severity, pass/fail). That gap, plus the absence of privacy/processing details, leaves an agent unable to predict 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 description coverage is 100%, so both parameters (tools and _paymentSignature) are already documented in the schema; the description adds no syntax, format, or shape detail beyond what is there. It does contextually support the payment-signature parameter by naming the x402 pricing model, which is a minor value-add over 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 and resource ("Audits ... MCP tool definitions") plus the four concrete checks it performs: schema validity, token bloat, description-poisoning/prompt injection, and missing bounds. This scopes it apart from generic siblings like prompt_injection_scan, though the overlap on "prompt injection" is never explicitly disambiguated.

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?

Usage is only implied — the tool is for validating tool definitions, presumably before publishing. There is no explicit when-to-use statement, no prerequisites, and no named alternative among the many linter-style siblings (json_config_preflight, prompt_injection_scan, openapi_breaking_diff).

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