Skip to main content
Glama

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.2/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false. The description adds valuable context beyond annotations: it explicitly states 'does NOT touch funds and does NOT submit anything' and clarifies it is 'a calldata builder'. No contradiction with annotations; the added safety framing earns a 4.

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?

Three sentences, front-loaded with the core purpose, followed by return contents and safety disclaimers. Every sentence earns its place; no fluff or redundancy.

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?

Given the complexity (10 params, 3 protocols, 2 chains) and the rich schema/annotations, the description covers the essential context: supported protocol/chain combos, what the tool returns, and its non-submitting nature. It doesn't enumerate edge cases like Morpho-specific parameter behavior, but the schema already handles that, and the description sufficiently frames the tool's role.

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 100% — every parameter has a description in the schema. The tool description adds no parameter-level semantics beyond the schema; it only summarizes supported protocols and return fields. Per the rubric, baseline 3 is appropriate when the schema does the heavy lifting.

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 opens with a specific verb+resource: 'Build agent-ready calldata for a liquidation transaction.' It further clarifies what is returned (target contract address, calldata, gas limit, value, chain) and explicitly differentiates from sibling tools like submit_bundle and the various get_* tools by stating it builds calldata only and does not submit.

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?

The description clearly establishes when to use the tool: to produce calldata that an agent will later sign and submit via submit_bundle. It also implies a contrast with submit_bundle by stating this tool does not submit anything, but it does not explicitly name alternative tools or exclusion criteria, so it falls short of a 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
Disambiguation4/5

Most tools have distinct purposes (e.g., builder recommendation vs. bundle submission recommendation, liquidation waves vs. risk-enriched feed). However, a few pairs like `get_builder_recommendation` and `recommend_bundle_submission` could be confused, though descriptions differentiate them.

Naming Consistency5/5

All tool names follow a consistent verb_noun pattern in snake_case (e.g., `get_liquidation_waves`, `submit_bundle`, `predict_liquidation_probability`). No mixing of styles.

Tool Count5/5

9 tools is appropriate for the MEV intelligence domain, covering opportunity discovery, prediction, builder recommendation, and submission without being excessive or too few.

Completeness4/5

The tool set covers the full workflow from monitoring to execution, including reporting and leaderboard. A minor gap is the lack of a direct tool to check submission status, though a tracking ID is provided for external query.

Resources