Skip to main content
Glama

Preview an action (simulate before executing)

preview_action
Read-only

Simulate a supply/borrow/withdraw/repay against a wallet's position WITHOUT executing, on v3 or v4. Always do this before a borrow or a withdraw. Send only the arguments that apply: v4 takes 'reserve'; v3 takes 'market' + 'token' + 'chainId'; 'max' is for withdraw and repay; 'native' works on both; 'enableCollateral' is v4 only. What comes back differs by version, because the two protocols offer different amounts of it: v4 returns the resulting health factor, net APY, borrowing power and rewards; v3 returns the health factor before and after, and nothing else. Either version also returns 'warnings' when the action would not actually succeed - an error level there means the prepare step will refuse it, so fix the inputs rather than building it. Simulate first even when you intend to build immediately: this is the cheapest way to find out that an action cannot succeed, and it commits nothing. It reports the position's own limits and not token allowances, so a clean simulation says the position allows this, not that no approval step remains.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
maxNoWithdraw/repay only: use the entire balance/debt.
tokenNov3 only: underlying token address.
actionYesAction to simulate.
amountNoAmount in MAIN units (e.g. '10.5'), never base units: 100000 base units of a 6-decimal token is '0.1', not '100'. Convert before sending if the user stated base units. Omit only if max=true.
marketNov3 only: market pool address, from a get_markets row in this session. It cannot be recalled: an Aave pool address you already recognise belongs to another deployment (v2, or another chain) and is rejected.
nativeNoUse the chain's native gas token instead of an ERC-20, on either version. Pass it whenever the action is in the native token, or the balance check below reads the wrapped ERC-20 balance and can refuse a supply that would work.
senderYesSender wallet address, 0x-prefixed (40 hex chars).
chainIdNov3 only: chain id (positive integer).
reserveNov4 only: the opaque reserveId, copied verbatim from a get_markets row or a get_position_items item in this session (e.g. 'MTo6MHg5NGU3...Ojo1') - it cannot be constructed or recalled, so fetch one before the first call rather than after a refusal. The 'spokeId' from get_user_positions is NOT this: it is the same encoding one segment short, names the spoke rather than a reserve inside it, and is rejected. A token symbol such as 'USDC' is rejected too.
versionNoOptional: inferred from the reserve selector ('reserve' means v3 is not being used, 'market'+'token'+'chainId' means v4 is not). Send it to be explicit, or if you somehow set both.
enableCollateralNov4 supply only: also enable as collateral.

TDQS

A5/5.0
Behavior5/5

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

Annotations only say readOnlyHint=true, so the description adds substantial behavioral context: the operation commits nothing, return shapes differ by version, warnings signal non-succeeding actions, and the simulation reports position limits rather than token allowances. This goes well beyond the annotations and is operationally important.

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 long but every sentence carries operational value: version routing, argument selection, return differences, warning semantics, and simulation scope. It is front-loaded with the core directive and uses the remaining sentences for high-signal caveats rather than filler.

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 11 parameters, version-dependent behavior, and no output schema, the description is remarkably complete. It explains what each version returns, how to handle failure warnings, and the relationship to the prepare step, leaving no major gap an agent would need to infer.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema already documents each parameter, so the baseline is 3, but the description adds critical cross-parameter guidance: v4 uses 'reserve' while v3 uses 'market'+'token'+'chainId', 'max' only applies to withdraw/repay, 'enableCollateral' is v4-only, and it warns about non-constructible IDs and the 'spokeId' confusion. This materially improves correct invocation.

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 and resource: it simulates supply/borrow/withdraw/repay actions against a wallet's position on v3 or v4 without executing. It clearly differentiates this from a real execution or prepare step by stating it commits nothing, making the tool's purpose unmistakable alongside siblings like prepare_action.

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?

The description gives explicit guidance: 'Always do this before a borrow or a withdraw' and 'Simulate first even when you intend to build immediately.' It also explains why simulation is the cheapest way to detect failure and notes what a clean simulation does and does not mean, giving the agent clear conditions for use.

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