Skip to main content
Glama

tapp_add_stable_liquidity

Add token amounts to an existing stable pool on Tapp Exchange using the pool ID and specified token quantities to enhance liquidity.

Instructions

Add liquidity to an existing stable pool

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
amountsYesAn array of token amounts
poolIdYesThe ID of the stable pool

Implementation Reference

  • Defines the main handler function for the 'tapp_add_stable_liquidity' tool, including input schema validation with Zod and execution logic that delegates to TappAgent.addStableLiquidity method.
    export const AddStableLiquidityTool: McpTool = { name: "tapp_add_stable_liquidity", description: "Add liquidity to an existing stable pool", schema: { poolId: z.string().describe("The ID of the stable pool"), amounts: z.array(z.number()).describe("An array of token amounts") }, handler: async (agent: TappAgent, input: Record<string, any>) => { const result = await agent.addStableLiquidity({ poolId: input.poolId, amounts: input.amounts }); return { status: "success", transaction: result }; }, };
  • src/mcp/index.ts:45-45 (registration)
    Registers the AddStableLiquidityTool in the central TappExchangeMcpTools object, making it available as an MCP tool.
    "AddStableLiquidityTool": AddStableLiquidityTool,
  • Core helper method in TappAgent that generates the transaction payload using the external Tapp SDK and submits it via Aptos client, handling success/error responses.
    async addStableLiquidity(params: AddStableLiquidityParams): Promise<TransactionResponse> { try { const data = this.sdk.Position.addStableLiquidity(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' }; } }
  • Zod schema defining the input parameters for the tool: poolId (string) and amounts (array of numbers).
    schema: { poolId: z.string().describe("The ID of the stable pool"), amounts: z.array(z.number()).describe("An array of token amounts") },
  • src/mcp/index.ts:9-22 (registration)
    Import statement that brings in the AddStableLiquidityTool for registration in the MCP tools.
    import { CreateAMMPoolAndAddLiquidityTool, CreateCLMMPoolAndAddLiquidityTool, CreateStablePoolAndAddLiquidityTool, AddAMMLiquidityTool, AddCLMMLiquidityTool, AddStableLiquidityTool, RemoveSingleAMMLiquidityTool, RemoveMultipleAMMLiquidityTool, RemoveSingleCLMMLiquidityTool, RemoveMultipleCLMMLiquidityTool, RemoveSingleStableLiquidityTool, RemoveMultipleStableLiquidityTool } from "./tapp/liquidity-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