Skip to main content
Glama

write_account_remove_liquidity

Idempotent

Removes a specified amount of liquidity from an LP position while keeping it open with reduced liquidity and retaining underlying tokens in the account.

Instructions

Flash-action: PARTIALLY decreases liquidity from an LP position. The position remains open with reduced liquidity; underlying tokens stay in the account.

For FULL position exit (burn LP + swap + repay + withdraw), use write_account_close instead: it batches everything into one atomic transaction.

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.

Input Schema

NameRequiredDescriptionDefault
asset_idYesNFT token ID
chain_idNoChain ID: 8453 (Base), 130 (Unichain), 10 (Optimism), or 4663 (Robinhood)
adjustmentYesLiquidity amount to remove (raw uint128 value as string). Must be less than total liquidity: for full removal use write_account_close.
asset_addressYesPosition manager contract
account_addressYesArcadia account address

Output Schema

NameRequiredDescriptionDefault
afterNo
beforeNo
descriptionNo
transactionYes
price_checksNo
tenderly_sim_urlNo
tenderly_sim_statusNo
expected_value_changeNo
expected_value_change_unavailableNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.6.1
    • addedOutput schema / properties / expected_value_change_unavailable
      Added value: +{
      +  "type": "string"
      +}
    • addedOutput schema / properties / price_checks
      Added value: +{
      +  "items": {
      +    "additionalProperties": {},
      +    "properties": {
      +      "pool": {
      +        "type": "string"
      +      },
      +      "status": {
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "pool",
      +      "status"
      +    ],
      +    "type": "object"
      +  },
      +  "type": "array"
      +}
  2. Addedv0.6.0

TDQS

A4.6/5.0
Behavior5/5

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

Discloses behavior beyond annotations: the resulting state (position open, tokens retained), the time-sensitivity window (sign/broadcast within 30s), revert handling with an explicit retry-at-least-once instruction, and that the response carries tenderly_sim_url/tenderly_sim_status. Annotations only say non-readOnly, openWorld, idempotent, non-destructive – the description supplies the operational consequences.

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?

Front-loads the partial-vs-full distinction, then the alternative, then the timing/retry caveat. Three short paragraphs, each earning its place. Slightly long for its content but no filler sentences.

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?

For a mutating, time-sensitive transaction builder, it covers outcome state, sibling routing, timing constraints, failure/retry behavior, and available validation artifacts, while the output schema handles return shape. Nothing an agent needs to call it correctly is missing.

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 description coverage is 100%, so the schema already documents all five parameters including chain_id options and the uint128 adjustment constraint. The description reinforces the adjustment-vs-close distinction but adds no syntax or format detail beyond the schema. Baseline 3 is appropriate.

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?

States a specific verb and resource ('PARTIALLY decreases liquidity from an LP position') and disambiguates from its nearest sibling write_account_close by explaining what full exit does. An agent can distinguish it from write_account_add_liquidity or write_account_close without opening either schema.

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?

Explicit when-to-use (partial reduction, position stays open) and when-not-to-use, naming the alternative (write_account_close for full exit with burn+swap+repay+withdraw). Also gives a retry policy for reverts, leaving nothing to inference.

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