Skip to main content
Glama
x402-preflight-mcp

x402-preflight-mcp

by animus3d

evm_tx_risk_preflight

Decode EVM calldata, detect unlimited ERC-20 approvals and Permit2/setApprovalForAll drainers, and score transaction risk before signing.

Instructions

[x402 $0.05 USDC on Base/Solana] Decodes EVM calldata selectors, detects unlimited ERC-20 approve, Permit2/setApprovalForAll drainers, and scores transaction risk before signing.

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": {
      "to": "<to>",
      "data": "<data>"
    },
    "name": "evm_tx_risk_preflight"
  }
}

Input Schema

NameRequiredDescriptionDefault
toYesTarget contract address
dataYesHex-encoded calldata (0x...)
valueNoNative value in wei
chainIdNoEVM chain ID (e.g. 8453 for Base)
_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

A3.8/5.0
Behavior3/5

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

With no annotations, the description must carry the full behavioral load. It does disclose the important operational facts — paid tool, $0.05 USDC via x402, on Base or Solana — and that the operation is a pre-signing analysis. However it never states the return shape (numeric risk score? list of detected findings?) despite having no output schema, and does not say whether analysis is pure/read-only or how payment failure surfaces.

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 the monetization tag front-loaded, which is the right priority since cost affects the agent's decision to call. No filler, though the bracketed payment prefix and the tool body read as two competing leads rather than one integrated statement.

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?

Inputs are fully covered by the schema and the threat coverage is well specified, but for a security-scoring tool with no output schema, the absence of any description of the returned assessment is a real gap — an agent cannot plan how to interpret or relay the result. Payment mechanics are mentioned but not explained as a workflow step.

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%, with each of the five parameters documented including chainId examples and the _paymentSignature override behavior, so the description need add nothing. It adds nothing — no discussion of calldata formatting, selector edge cases, or when value/chainId can be omitted — so baseline 3 applies.

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 names a specific verb chain (decodes, detects, scores) and a precise resource (EVM calldata / transaction), and enumerates the exact threat classes it catches — unlimited approve, Permit2, setApprovalForAll drainers. This is clearly distinguishable from siblings like solidity_quickscan, which targets contract source rather than a pending transaction.

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 signing' establishes the trigger context — run this pre-signature on calldata you are about to authorize. That is clear situational guidance, but it names no alternatives and no when-not-to-use conditions, so the agent must infer that non-EVM or already-signed flows fall outside scope.

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