Skip to main content
Glama

evm_remove_liquidity

Burns DEX pool LP tokens to withdraw both paired tokens proportionally, including accrued fees, after approving the LP token for the router on supported EVM chains.

Instructions

Remove liquidity from DEX pool by burning LP tokens, retrieving both tokens proportionally.

CRITICAL RULES:

  • Burns LP tokens, receives tokenA and tokenB

  • Amounts proportional to pool share

  • Must approve LP token for router

  • Collected fees included in withdrawal

  • Transaction irreversible

PARAMETERS:

  • tokenA, tokenB: Original pair tokens (required)

  • liquidityAmount: LP tokens to burn (required)

  • slippageTolerance: "0.5" = 0.5% (required)

  • privateKey: Must hold LP tokens (required)

EXAMPLES: ✅ Remove 50% liquidity from USDC/WETH pool: {chain: "polygon", dex: "quickswap", tokenA: "0x2791Bca...", tokenB: "0x7ceB23fD...", liquidityAmount: "5.0", slippageTolerance: "0.5", privateKey: "0x..."}

WORKFLOW:

  1. Check LP token balance

  2. Approve LP token for router

  3. Remove liquidity (this tool)

  4. Receive tokenA + tokenB

SUPPORTED EVM CHAINS (7 networks): • ethereum (Sepolia) - EIP-1559 enabled, ~12s blocks, moderate gas costs • polygon (Amoy) - Low fees, fast finality (~2s), layer 2 • avalanche (Fuji C-Chain) - Sub-second finality, dynamic fees • bsc (BNB Testnet) - 3s blocks, low gas costs, Binance ecosystem • arbitrum (Sepolia) - Optimistic rollup, low fees, Ethereum security • base (Sepolia) - Coinbase layer 2, EIP-1559, low fees • worldchain (World Sepolia) - World Network testnet, EIP-1559

CRITICAL GAS CONSIDERATIONS:

  • Ethereum: High gas costs, use gas oracle for timing

  • Polygon/BSC: Very low gas, safe for frequent transactions

  • Arbitrum/Base: L2 optimizations, ~10-50x cheaper than Ethereum

  • Avalanche: Dynamic fees, can spike during congestion

  • Always check gas price before executing transactions

TESTNET TOKENS: All chains use testnet tokens with NO REAL VALUE. Faucets available for all supported networks.

Running on Linux.

LINUX-SPECIFIC NOTES:

  • Package manager: apt (Ubuntu/Debian), yum (RHEL/CentOS), or pacman (Arch)

  • Python 3 is typically 'python3' command

  • GNU tools are standard

  • Use 'xdg-open' command to open files/applications

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "chain": "<chain>",
      "dex": "<dex>",
      "tokenA": "<tokenA>",
      "tokenB": "<tokenB>",
      "liquidityAmount": "<liquidityAmount>",
      "slippageTolerance": "<slippageTolerance>",
      "privateKey": "<privateKey>"
    },
    "name": "evm_remove_liquidity"
  }
}

Input Schema

NameRequiredDescriptionDefault
dexYesDEX name (e.g., "uniswap", "quickswap", "traderjoe", "pancakeswap")
chainYesEVM chain to execute on
tokenAYesFirst token address (0x...)
tokenBYesSecond token address (0x...)
privateKeyYesPrivate key to sign transaction (0x...)
liquidityAmountYesAmount of LP tokens to burn (in ether units)
slippageToleranceYesSlippage tolerance percentage (e.g., "0.5" for 0.5%)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.5/5.0
Behavior4/5

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

With no annotations present, the description carries the full burden and does substantial work: it discloses that LP tokens get burned, that collected fees are included in the withdrawal, that the transaction is irreversible, and that an LP approval is required first. It does not say what happens when slippage is exceeded (revert vs. partial fill) or whether a deadline applies, which are the main behavioral gaps remaining.

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

Conciseness2/5

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

The core (purpose, critical rules, params, example, workflow) is well front-loaded and earns its place, but the definition is buried under a large amount of irrelevant padding: a seven-chain gas-cost essay, testnet-token notes, and an entirely off-topic 'LINUX-SPECIFIC NOTES' section about apt/yum/pacman and xdg-open. That noise inflates the text and dilutes the operative guidance an agent needs before signing an irreversible transaction.

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?

For an irreversible mutation tool with no annotations and no output schema, the definition covers the essentials an agent needs to call it correctly: token pair, LP amount, slippage format, signer requirement, and the approval prerequisite. The remaining shortfall is that it never describes transaction outcome or return value, which matters because no output schema exists to cover that.

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%, so the schema already documents all seven parameters, making 3 the baseline. The description does add some meaning beyond it — liquidityAmount is framed as LP tokens to burn, slippageTolerance is illustrated with the '0.5' = 0.5% convention, and privateKey is constrained to 'Must hold LP tokens' — but the worked example and rule list largely echo schema content rather than extending it.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The first sentence names a specific verb and resource ('Remove liquidity from DEX pool by burning LP tokens') and adds the mechanism ('retrieving both tokens proportionally'), which distinguishes it from a deposit-style sibling. It never names evm_add_liquidity or evm_get_user_liquidity as the contrasting alternative, so the differentiation is implicit rather than explicit.

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

Usage Guidelines3/5

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

The WORKFLOW block situates the call in a sequence (check LP balance, approve LP token, then remove) and the rules state 'Must approve LP token for router', which is genuinely actionable prerequisite guidance. However, there is no when-not guidance (e.g., what to do instead if the user has no LP position, or how this differs from a plain swap) and no alternatives are named.

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

Deploy Server

Other Tools