Skip to main content
Glama

A2A Gateway — Base Token Guard & x402 Settlement

simulate_mev_route_safety

EPH-02 CRITICAL PRE-EXECUTION SIMULATION GATEWAY for Flashloans & MEV routes on Base (ChainID 8453). Executes read-only EVM sandbox tracing before broadcasting real arbitrage or swap routes to mainnet. Detects hidden reverts, slippage traps, fee-on-transfer hooks, and gas bombs. Zero host OS privilege, strictly memory-isolated. Charges 1.50 USDC via x402 on Base. Clients that cannot send _meta may pass payment_method ('points' or 'onchain'), invoice_id, signature and (for on-chain) tx_hash as arguments instead. Supply payer_address. For redemption pass invoice_id and signature in _meta.x402/payment, with tx_hash for on-chain payment or method=points where supported. Settlement errors set isError and _meta.x402/payment-error.status_code; 503 indicates admission unavailable, while a 409 uncertain outcome must not be automatically retried.

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": {
      "target_address": "<target_address>",
      "payer_address": "<payer_address>"
    },
    "name": "simulate_mev_route_safety"
  }
}

Input Schema

NameRequiredDescriptionDefault
valueNoNative ETH value in wei (default 0)
tx_hashNoBase mainnet USDC transfer hash for on-chain settlement.
calldataNoHex encoded calldata (e.g. 0x06fdde03)
signatureNoEIP-191 signature over challengeToSign by payer_address.
invoice_idNoinvoiceId from the payment-required response.
payer_addressYesPayer wallet for invoice creation and redemption
payment_methodNoSettlement rail. 'points' spends membership points; 'onchain' verifies tx_hash.
target_addressYesSmart contract address on Base

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changed
    • addedInput schema / properties / invoice_id
      Added value: +{
      +  "description": "invoiceId from the payment-required response.",
      +  "type": "string"
      +}
    • addedInput schema / properties / payment_method
      Added value: +{
      +  "description": "Settlement rail. 'points' spends membership points; 'onchain' verifies tx_hash.",
      +  "enum": [
      +    "points",
      +    "onchain"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / signature
      Added value: +{
      +  "description": "EIP-191 signature over challengeToSign by payer_address.",
      +  "type": "string"
      +}
    • addedInput schema / properties / tx_hash
      Added value: +{
      +  "description": "Base mainnet USDC transfer hash for on-chain settlement.",
      +  "type": "string"
      +}
  2. First observed

TDQS

A4.1/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and discloses that the tool is read-only, memory-isolated, charges 1.50 USDC via x402, supports payment fallback and redemption paths, and defines settlement-error handling including a non-retry rule for 409. These are substantive behavioral traits beyond a bare 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?

The purpose is front-loaded and most sentences carry operational information relevant to calling the tool. The all-caps label and compressed payment/error details make it dense and somewhat run-on, but it remains appropriately sized for a complex paid gateway.

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 description is complete on purpose, payment, isolation, and error behavior, and the input schema is fully documented. However, with no output schema, it never explains what a successful simulation returns—such as a trace, revert details, or a safety verdict—leaving a material gap for a simulation tool.

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

Parameters4/5

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

Schema coverage is 100%, so the schema already documents all eight inputs; the description adds payment-rail semantics for payment_method, invoice_id, signature, tx_hash, and payer_address, including the _meta.x402/payment redemption path. It adds less meaning for target_address, calldata, and value, but still exceeds the baseline.

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 names a specific operation—read-only EVM sandbox tracing of MEV/arbitrage and swap routes on Base—and lists the failure modes it detects. It is distinguishable from token-safety or generic protocol-reasoning tools by its pre-broadcast route-simulation scope, though it never explicitly names an alternative.

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 clear when-to-use context: before broadcasting real arbitrage or swap routes to mainnet, as a pre-execution safety check. It does not state when not to use it or explicitly name an alternative tool, so the selection guidance is contextual rather than 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.

Resources