Skip to main content
Glama
tamago-labs

Tapp Exchange MCP Server

by tamago-labs

tapp_remove_single_amm_liquidity

Remove liquidity from a specified AMM position by burning share tokens and withdrawing tokens, ensuring minimum token amounts are met. Part of the Tapp Exchange MCP Server for decentralized exchange operations.

Instructions

Remove liquidity from a single AMM position

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
minAmount0YesMinimum amount of token0
minAmount1YesMinimum amount of token1
mintedShareYesThe amount of share tokens to burn
poolIdYesThe ID of the AMM pool
positionAddrYesThe address of the liquidity position

Implementation Reference

  • The handler function for the 'tapp_remove_single_amm_liquidity' MCP tool. It parses the input parameters and delegates to the TappAgent's removeSingleAMMLiquidity method, returning the transaction response.
    handler: async (agent: TappAgent, input: Record<string, any>) => {
        const result = await agent.removeSingleAMMLiquidity({
            poolId: input.poolId,
            positionAddr: input.positionAddr,
            mintedShare: input.mintedShare,
            minAmount0: input.minAmount0,
            minAmount1: input.minAmount1
        });
        return {
            status: "success",
            transaction: result
        };
    },
  • Zod input schema defining the parameters for removing single AMM liquidity: poolId, positionAddr, mintedShare, minAmount0, minAmount1.
    schema: {
        poolId: z.string().describe("The ID of the AMM pool"),
        positionAddr: z.string().describe("The address of the liquidity position"),
        mintedShare: z.number().describe("The amount of share tokens to burn"),
        minAmount0: z.number().describe("Minimum amount of token0"),
        minAmount1: z.number().describe("Minimum amount of token1")
    },
  • src/mcp/index.ts:48-48 (registration)
    Registration of the RemoveSingleAMMLiquidityTool (named 'tapp_remove_single_amm_liquidity') in the central TappExchangeMcpTools object used for MCP tool list.
    "RemoveSingleAMMLiquidityTool": RemoveSingleAMMLiquidityTool,
  • Supporting TappAgent method that generates the transaction payload via the Tapp SDK's Position.removeSingleAMMLiquidity and submits it using Aptos SDK.
    async removeSingleAMMLiquidity(params: RemoveSingleAMMLiquidityParams): Promise<TransactionResponse> {
        try {
            const data = this.sdk.Position.removeSingleAMMLiquidity(params);
            const response = await this.aptos.transaction.submit.simple({
                sender: this.account.accountAddress,
                data: data
            } as any);
    
            return {
                hash: response.hash,
                success: true
            };
        } catch (error) {
            return {
                hash: '',
                success: false,
                error: error instanceof Error ? error.message : 'Unknown error'
            };
        }
    }
Behavior2/5

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

With no annotations provided, the description carries full burden but offers minimal behavioral insight. It states the action is a removal but doesn't disclose critical traits like whether it's destructive (likely yes, but unconfirmed), requires authentication, involves transaction fees, or has rate limits. The description lacks context on outcomes or risks.

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 a single, efficient sentence with zero wasted words. It's front-loaded with the core action and target, making it easy to parse quickly. Every word earns its place without redundancy.

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?

For a tool with 5 parameters, no annotations, and no output schema, the description is incomplete. It doesn't address behavioral aspects (e.g., mutation effects, error conditions) or provide usage context, leaving significant gaps for an AI agent to understand how and when to invoke it safely.

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%, providing clear parameter definitions. The description adds no additional meaning beyond the schema, such as explaining parameter relationships (e.g., how 'mintedShare' relates to liquidity) or usage nuances. Baseline score of 3 applies since the schema does the heavy lifting.

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 clearly states the action ('Remove liquidity') and target ('from a single AMM position'), distinguishing it from sibling tools like 'tapp_remove_multiple_amm_liquidity' by specifying 'single'. However, it doesn't fully differentiate from other single-removal tools like 'tapp_remove_single_clmm_liquidity' beyond mentioning 'AMM'.

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?

No guidance is provided on when to use this tool versus alternatives. The description doesn't mention prerequisites (e.g., needing an existing position), contrast with 'tapp_remove_multiple_amm_liquidity' for bulk operations, or explain why 'single' removal might be preferred over other methods.

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

Related 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/tamago-labs/tapp-exchange-mcp'

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