Skip to main content
Glama

MEV sandwich check

mev_sandwich_check
Read-only

Check whether an EVM swap was sandwiched from its chain and transaction hash by detecting a same-pool front-run and reversing back-run from one EOA within 8 block positions.

Instructions

Was this swap sandwiched? Looks for a same-pool same-direction front-run and reversing back-run from the same EOA/bot within 8 positions in the block (heuristic).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
hashYes
chainYesEVM chain: ethereum, base, arbitrum, optimism, polygon, bsc, avalanche

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.3.0

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and openWorldHint=true, so the safety profile is covered. The description adds meaningful behavioral context beyond that: it explicitly calls the check a heuristic, names the front-run/back-run pattern it detects, requires the same EOA/bot, and bounds the search to 8 positions in the block.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two tightly written sentences. The diagnostic question is front-loaded, and the detection criteria follow immediately with no wasted words.

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 read-only heuristic, the description gives enough for correct invocation and interpretation of the check's scope. It does not describe the return shape or confidence/evidence output, which is a minor gap given there is no output schema.

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%: chain has a full enum description and hash is pattern-constrained but otherwise undocumented. The description uses 'this swap' and 'in the block' to imply hash is the swap transaction, but it does not explain either parameter directly, so the schema still carries most of the burden.

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 answers a specific yes/no question about a swap and then states the exact heuristic: same-pool same-direction front-run plus reversing back-run from the same EOA/bot within 8 block positions. This distinguishes it from general transaction decoders and MEV-adjacent siblings like uniswap_price_impact.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The question form implies the use case, but there is no explicit when-to-use guidance, no prerequisites, and no mention of alternatives or when not to rely on the heuristic. It defines what the tool checks, not when an agent should choose it over decode_transaction or other investigation tools.

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