Skip to main content
Glama

build_remove_liquidity

Remove liquidity from a trading pair on the Casper Network by building an unsigned transaction with specified percentage, slippage, and deadline parameters.

Instructions

Build an unsigned remove-liquidity transaction

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pairYesPair contract package hash
percentageYesPercentage of liquidity to remove (1-100)
slippage_bpsNoSlippage in basis points (default 300)
deadline_minutesNoDeadline in minutes (default 20)
sender_public_keyYesSender hex public key

Implementation Reference

  • The handler function for the `build_remove_liquidity` MCP tool. It calls the `client.buildRemoveLiquidity` method and saves the resulting transaction to a file.
      async (args) => {
        const bundle = await client.buildRemoveLiquidity({
          pairContractPackageHash: args.pair,
          percentage: args.percentage,
          slippageBps: args.slippage_bps,
          deadlineMinutes: args.deadline_minutes,
          senderPublicKey: args.sender_public_key,
        });
        const deployPath = await writeDeployFile(bundle.transactionJson);
        return { content: [{ type: 'text' as const, text: bundle.summary + `\n\nUnsigned transaction saved to: ${deployPath}` }] };
      },
    );
  • Registration of the `build_remove_liquidity` tool, including its schema definitions.
    server.tool(
      'build_remove_liquidity',
      'Build an unsigned remove-liquidity transaction',
      {
        pair: z.string().describe('Pair contract package hash'),
        percentage: z.number().min(1).max(100).describe('Percentage of liquidity to remove (1-100)'),
        slippage_bps: z.number().optional().describe('Slippage in basis points (default 300)'),
        deadline_minutes: z.number().optional().describe('Deadline in minutes (default 20)'),
        sender_public_key: z.string().describe('Sender hex public key'),
      },
      async (args) => {
        const bundle = await client.buildRemoveLiquidity({
          pairContractPackageHash: args.pair,
          percentage: args.percentage,
          slippageBps: args.slippage_bps,
          deadlineMinutes: args.deadline_minutes,
          senderPublicKey: args.sender_public_key,
        });
        const deployPath = await writeDeployFile(bundle.transactionJson);
        return { content: [{ type: 'text' as const, text: bundle.summary + `\n\nUnsigned transaction saved to: ${deployPath}` }] };
      },
    );
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions 'unsigned' to indicate non-execution, but fails to describe what the transaction does (burns LP tokens, returns underlying assets), the output format, or security considerations like slippage protection.

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 single sentence is efficiently structured and front-loaded with the action. However, for a complex DeFi operation with no output schema and no annotations, it may be overly terse rather than appropriately concise.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of liquidity removal (financial operation with impermanent loss risks, multi-step transaction flow) and absence of output schema, the description is incomplete. It omits the transaction lifecycle, output payload structure, and economic effects of the operation.

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 has 100% description coverage, documenting all 5 parameters including constraints (percentage 1-100). The description adds no additional semantic context beyond the schema, which warrants the baseline score for well-documented schemas.

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 description uses a specific verb ('Build') and resource ('remove-liquidity transaction'), and includes 'unsigned' which distinguishes it from the sibling 'submit_transaction'. It clearly differentiates from 'build_add_liquidity' and 'build_swap' through the specific operation name.

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

Usage Guidelines2/5

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

While 'unsigned' hints that signing and submission happen elsewhere, there is no explicit guidance on the required workflow (build → sign → submit), when to use this versus 'build_swap', or prerequisites like existing liquidity positions.

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/make-software/cspr-trade-mcp'

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