Skip to main content
Glama

evm_detect_sandwich

Detects MEV sandwich attacks by analyzing transactions or blocks for frontrun-victim-backrun patterns, identifying sandwich bots, victims, and estimated profits.

Instructions

Detect MEV sandwich attacks in transactions or blocks.

Analyzes transactions for frontrunning patterns where attackers profit by sandwiching user trades. Identifies sandwich bots, victims, and profit estimates.

PARAMETERS:

  • chain: Target EVM chain

  • transactionHash: Check if specific tx was sandwiched (optional)

  • blockNumber: Analyze all sandwich attacks in block (optional)

  • victimAddress: Check if address was victimized (optional)

  • timeWindow: Number of recent blocks to analyze (default: 100)

DETECTION: • Identifies frontrun + victim + backrun patterns • Detects same-attacker sequences • Recognizes DEX interaction signatures • Provides MEV protection recommendations

Returns detected sandwich patterns, statistics, and protection strategies.

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": {
      "chain": "<chain>"
    },
    "name": "evm_detect_sandwich"
  }
}

Input Schema

NameRequiredDescriptionDefault
chainYes
timeWindowNoRecent blocks to analyze (default: 100)
blockNumberNoBlock number to analyze
victimAddressNoCheck if address was sandwich victim
transactionHashNoTransaction hash to analyze

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

B3.4/5.0
Behavior3/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 disclose the detection heuristics (same-attacker sequences, DEX interaction signatures) and that results include statistics and protection strategies. It omits operational traits an agent would want: cost/latency of scanning many blocks, behavior on invalid or non-existent hashes, and whether analysis is read-only against chain data.

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

Conciseness3/5

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

Front-loaded and bulleted, but the DETECTION list largely repeats what the opening paragraph already said ('frontrun + victim + backrun' echoes 'frontrunning patterns where attackers profit by sandwiching'). The parameter block duplicates the schema verbatim, so several lines do not earn their place.

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 five-parameter, read-only analytical tool with no annotations and no output schema, the description is broadly sufficient: it names the detection patterns and the shape of the return (patterns, statistics, recommendations). The remaining gap is the absence of any guidance on combining the optional filters or on result size.

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 80%, so the baseline is 3. The description restates each parameter in near-identical wording to the schema (e.g. 'Check if specific tx was sandwiched' vs. 'Transaction hash to analyze') without adding the missing semantics, notably whether the three optional filters are mutually exclusive and how timeWindow interacts with an explicit blockNumber.

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 opening sentence gives a specific verb and resource ('Detect MEV sandwich attacks in transactions or blocks') and the second paragraph narrows the semantics to frontrun/victim/backrun sequences. No sibling tool in the catalog covers MEV detection, but the description never states that distinction explicitly, so it stops short of a 5.

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 through the parameter list, which marks transactionHash, blockNumber, and victimAddress as optional modes of inquiry. The description never says when to prefer one mode over another, whether modes can be combined, or what the default scan (chain + timeWindow) means when nothing else is supplied.

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

Deploy Server

Other Tools