Skip to main content
Glama

Prepare a liquidation

prepare_liquidation
Read-only

Build an unsigned transaction to liquidate an unhealthy position: repay part of someone else's debt and receive their collateral plus the liquidation bonus. Only viable while that position's health factor is below 1 (check get_user_summary for the target). v4 takes collateral and debt as reserveIds; v3 takes collateralToken and debtToken addresses plus chainId. Non-custodial: the liquidator signs and submits.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
maxNoCover the maximum the protocol allows.
debtNov4 only: reserveId of the debt to repay.
userYesThe wallet being liquidated (0x, 40 hex).
amountNoDebt to cover, in main units. Omit only if max=true.
marketNov3 only: market pool address (from get_markets).
chainIdNov3 only: chain id (positive integer).
versionYesProtocol version (v3 or v4; required, no 'all' for actions).
debtTokenNov3 only: debt token address.
collateralNov4 only: reserveId of the collateral to seize.
liquidatorNov4 only: the wallet performing the liquidation (0x, 40 hex). On v3 the liquidator is whoever signs the returned transaction.
collateralTokenNov3 only: collateral token address.

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already flag readOnlyHint=true, and the description adds important behavioral nuance: the tool builds an unsigned transaction rather than executing it, and the liquidator signs and submits. It also discloses the liquidation mechanics (repay part of debt, receive collateral and bonus) and the health-factor dependency. This goes beyond the annotation without contradicting it.

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 dense sentences deliver the core purpose, the precondition, the version-specific parameter conventions, and the custody model without repetition or filler. Key facts are front-loaded, and every clause earns its 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?

Given 11 parameters, 2 required, and no output schema, the description covers the critical preconditions, version distinctions, and non-custodial behavior. It could also spell out the expected return format in slightly more detail, but the schema already documents parameter meanings thoroughly, so nothing essential is missing for correct invocation.

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 baseline is 3. The description adds meaningful cross-version semantics by explicitly mapping collateral/debt to v4 reserveIds and collateralToken/debtToken/chainId to v3, which helps an agent disambiguate parameters that would otherwise look similar from schemas alone.

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 action—'Build an unsigned transaction to liquidate an unhealthy position'—and clearly defines what the tool accomplishes: repaying debt and receiving collateral plus bonus. It also distinguishes the two protocol versions by their parameter conventions, making it easy to tell this apart from generic prepare_* siblings.

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

Usage Guidelines5/5

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

It gives an explicit viability condition ('Only viable while that position's health factor is below 1') and tells the agent to check get_user_summary for the target, which is actionable routing guidance. It also clarifies version-specific inputs and the non-custodial signing flow, so the agent knows both when and how to use the tool.

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.1/5.0
Disambiguation4/5

The tool set is organized into clear read/prepare/action families, and cross-references like get_user_positions vs get_user_summary or get_markets vs get_reserve_details keep purposes distinct. A couple of generic names—prepare_action vs prepare_order, preview_action vs prepare_action—could cause misselection, but the descriptions explicitly separate them.

Naming Consistency4/5

Names overwhelmingly follow a verb_noun snake_case pattern: get_* for reads, prepare_* for transaction builders, plus cancel_order and submit_signed_order. The pattern is consistent overall, though a few generic exceptions like get_started, get_aave_guide, and preview_action break the strict resource-noun convention.

Tool Count2/5

With 40 tools, the set is well past the 25+ threshold and feels heavy even though the domain is broad. Most tools are distinct and justified, but an agent must navigate a very large list, and the server could reasonably be split into protocol, governance, and swap/order surfaces.

Completeness4/5

The surface covers v3/v4 reads, positions, health factors, simulations, transaction building, collateral, eMode, liquidation, rewards, sGHO, swaps/orders, and governance proposal reads, with clear sequencing between preview, prepare, and submit. Minor gaps exist—governance has no voting transaction and stkGHO balance/cooldown state is not readable—but they do not block the core Aave workflows.

Resources