Skip to main content
Glama
tamago-labs

Tapp Exchange MCP Server

by tamago-labs

tapp_remove_single_stable_liquidity

Removes liquidity from a single STABLE pool position on Tapp Exchange. Specify the pool ID, position address, share tokens to burn, and minimum token amounts to withdraw.

Instructions

Remove liquidity from a single STABLE position

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
poolIdYesThe ID of the stable pool
positionYesThe position object

Implementation Reference

  • Defines the MCP tool 'tapp_remove_single_stable_liquidity' including its Zod input schema and async handler function that delegates to TappAgent.removeSingleStableLiquidity.
    export const RemoveSingleStableLiquidityTool: McpTool = {
        name: "tapp_remove_single_stable_liquidity",
        description: "Remove liquidity from a single STABLE position",
        schema: {
            poolId: z.string().describe("The ID of the stable pool"),
            position: z.object({
                positionAddr: z.string().describe("The address of the individual liquidity position"),
                mintedShare: z.number().describe("The amount of share tokens to burn"),
                amounts: z.array(z.number()).describe("The minimum token amounts to receive")
            }).describe("The position object")
        },
        handler: async (agent: TappAgent, input: Record<string, any>) => {
            const result = await agent.removeSingleStableLiquidity({
                poolId: input.poolId,
                position: input.position
            });
            return {
                status: "success",
                transaction: result
            };
        },
    };
  • Zod schema defining the input parameters for the tool: poolId and position object with positionAddr, mintedShare, and amounts.
    schema: {
        poolId: z.string().describe("The ID of the stable pool"),
        position: z.object({
            positionAddr: z.string().describe("The address of the individual liquidity position"),
            mintedShare: z.number().describe("The amount of share tokens to burn"),
            amounts: z.array(z.number()).describe("The minimum token amounts to receive")
        }).describe("The position object")
    },
  • src/mcp/index.ts:48-53 (registration)
    Registers the RemoveSingleStableLiquidityTool in the TappExchangeMcpTools object export used for MCP server.
    "RemoveSingleAMMLiquidityTool": RemoveSingleAMMLiquidityTool,
    "RemoveMultipleAMMLiquidityTool": RemoveMultipleAMMLiquidityTool,
    "RemoveSingleCLMMLiquidityTool": RemoveSingleCLMMLiquidityTool,
    "RemoveMultipleCLMMLiquidityTool": RemoveMultipleCLMMLiquidityTool,
    "RemoveSingleStableLiquidityTool": RemoveSingleStableLiquidityTool,
    "RemoveMultipleStableLiquidityTool": RemoveMultipleStableLiquidityTool,
  • TappAgent helper method that calls the SDK to generate transaction payload for removing stable liquidity and submits it via Aptos client.
    async removeSingleStableLiquidity(params: RemoveSingleStableLiquidityParams): Promise<TransactionResponse> {
        try {
            const data = this.sdk.Position.removeSingleStableLiquidity(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'
            };
        }
    }

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