Skip to main content
Glama

write.account.deleverage

Idempotent

Sell account collateral to repay debt in a single atomic transaction without wallet tokens. Use for standalone repayment while keeping the position active.

Instructions

Multi-step flash-action: sells account collateral to the debt token and repays in one atomic transaction — no wallet tokens needed. To repay from wallet tokens instead, use write.account.repay. NOTE: If you are closing a position (remove LP + swap + repay + withdraw), prefer write.account.close which batches everything atomically. Only use this tool for standalone repayment while keeping the position active. The returned calldata is time-sensitive — sign and broadcast within 30 seconds. If the transaction reverts due to price movement, rebuild and sign again immediately (retry at least once before giving up). Response includes tenderly_sim_url and tenderly_sim_status for pre-broadcast validation — if tenderly_sim_status is 'false', do NOT broadcast the transaction.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
account_addressYesArcadia account address
amount_inYesCollateral amount to sell (raw units)
asset_fromYesCollateral token to sell
numeraireYesDebt token address
creditorYesLending pool address
slippageNoBasis points, 100 = 1%
chain_idNoChain ID: 8453 (Base), 130 (Unichain), or 10 (Optimism)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
descriptionNo
transactionYes
tenderly_sim_urlNo
tenderly_sim_statusNo
expected_value_changeNo
beforeNo
afterNo
Behavior1/5

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

The description contradicts the annotations: annotations set idempotentHint=true, but the description states the returned calldata is time-sensitive and must be rebuilt if the transaction reverts, implying non-idempotence. Per scoring rules, a contradiction yields a score of 1.

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

Conciseness4/5

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

The description is front-loaded with the main purpose, followed by usage guidelines and behavioral caveats. It is structured logically, but slightly verbose with 7 sentences; could be more concise without losing value.

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?

Covers essential context: atomicity, alternatives, time-sensitivity, retry logic, and pre-broadcast validation. Given the tool's complexity and the presence of an output schema (mentioned in context signals), the description is sufficiently complete.

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?

Input schema covers 100% of parameters with descriptions. The description adds minimal new meaning beyond the schema, such as 'no wallet tokens needed,' but the parameters are already well-documented. Baseline for high coverage is 3.

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 clearly states the tool's function: 'sells account collateral to the debt token and repays in one atomic transaction — no wallet tokens needed.' It distinguishes itself from sibling tools like write.account.repay and write.account.close.

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?

Explicitly tells when to use (standalone repayment while keeping position active) and when not to use (closing a position, which should use write.account.close, or repaying from wallet tokens, which should use write.account.repay). Provides clear alternatives.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/arcadia-finance/mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server