Skip to main content
Glama

MEV Intelligence

build_liquidation_tx

Read-only

Build agent-ready calldata for a liquidation transaction. Returns the target protocol contract address, ABI-encoded calldata, suggested gas limit, value, and chain — everything an agent needs to sign and submit via submit_bundle. Supports Aave V3 (L1 + Base), Spark (L1), and Morpho Blue (L1). Returns calldata only — the agent signs and submits separately. This tool does NOT touch funds and does NOT submit anything; it is a calldata builder.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
chainYesChain to build calldata for. base only supported for aave-v3.
borrowerYes0x-prefixed address of the borrower being liquidated.
protocolYesLending protocol. aave-v3 supported on ethereum + base. spark and morpho on ethereum only.
debt_assetYes0x-prefixed address of the debt token to repay. For Morpho, this field is ignored.
debt_to_coverYesAmount of debt token to repay in wei (string to avoid precision loss). Use "max" or the uint256 max value 0xff..ff to liquidate as much as possible (Aave V3 close factor applies).
receive_a_tokenNoAave V3 only. If true, receive collateral as aToken (saves gas, no unwrap). If false, receive underlying. Default false.
collateral_assetYes0x-prefixed address of the collateral token to seize. For Morpho, this field is ignored (market ID supplies it).
morpho_market_idNoMorpho Blue market id (bytes32). Required when protocol=morpho.
morpho_repaid_sharesNoMorpho Blue only. Amount of debt shares to repay. Mutually exclusive with morpho_seized_assets.
morpho_seized_assetsNoMorpho Blue only. Amount of collateral to seize in wei. Mutually exclusive with morpho_repaid_shares.

TDQS

A4.5/5.0
Behavior5/5

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

The description explicitly discloses that the tool does not touch funds and does not submit anything, and lists the return fields (target address, calldata, gas limit, value, chain). This adds meaningful behavioral context beyond the readOnlyHint/destructiveHint annotations, clarifying what 'read-only' means in this context.

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?

The description is three sentences, front-loaded with the main purpose, and contains no unnecessary repetition. Every sentence adds value: purpose, output/scope, and explicit safety boundary.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given there is no output schema, the description properly explains the return values and the tool's scope, making it complete for agent use. It also clarifies supported protocols and chains, which is crucial for a multi-protocol tool.

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?

The schema provides 100% parameter descriptions, so the baseline is 3. The description adds minimal parameter-specific detail beyond what the schema already covers, but it doesn't need to since the schema is thorough.

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 uses a specific verb ('Build') and resource ('agent-ready calldata for a liquidation transaction'), and explicitly differentiates from siblings by positioning it as a calldata builder that feeds into submit_bundle. It also lists supported protocols and chains, making the tool's scope unmistakable.

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 clearly indicates the tool builds calldata for later submission via submit_bundle and explicitly states it does not submit anything, giving a clear usage boundary. However, it doesn't explicitly contrast with other sibling tools like get_builder_recommendation, so it's not a perfect 5.

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.

TDQS

A4.4/5.0
Disambiguation5/5

Each tool has a clearly distinct purpose: building calldata, getting builder recommendations, daily reports, listing borrowers, grabbing an opportunity stream, viewing leaderboards, monitoring crossing candidates, predicting probabilities, recommending submission, and submitting bundles. No overlapping functionality.

Naming Consistency5/5

All tool names follow a consistent verb_noun pattern in lower_snake_case (e.g., build_liquidation_tx, get_builder_recommendation, submit_bundle), making it easy to predict tool behavior from names.

Tool Count5/5

With 10 tools, the set is well-scoped for an MEV intelligence server. It covers the full workflow from opportunity discovery to bundle submission without being bloated or sparse.

Completeness4/5

The tool set covers the core liquidation workflow comprehensively (identify, predict, build, recommend, submit). A minor gap is the lack of a dedicated tool to check submission status, relying on an external endpoint instead.

Resources