Skip to main content
Glama

tapp_add_amm_liquidity

Add liquidity to an AMM pool by specifying the pool ID and amounts of token A and token B. Facilitates enhanced liquidity provision on Tapp Exchange via the Aptos blockchain.

Instructions

Add liquidity to an existing AMM pool

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
amountAYesThe amount of token A to add as liquidity
amountBYesThe amount of token B to add as liquidity
poolIdYesThe ID of the AMM pool

Implementation Reference

  • The handler function that executes the tapp_add_amm_liquidity tool logic by calling TappAgent.addAMMLiquidity with parsed input parameters.
    handler: async (agent: TappAgent, input: Record<string, any>) => { const result = await agent.addAMMLiquidity({ poolId: input.poolId, amountA: input.amountA, amountB: input.amountB }); return { status: "success", transaction: result }; },
  • Zod schema defining the input parameters for the tapp_add_amm_liquidity tool: poolId, amountA, and amountB.
    schema: { poolId: z.string().describe("The ID of the AMM pool"), amountA: z.number().describe("The amount of token A to add as liquidity"), amountB: z.number().describe("The amount of token B to add as liquidity") },
  • src/mcp/index.ts:42-45 (registration)
    Registration of the AddAMMLiquidityTool (tapp_add_amm_liquidity) in the main TappExchangeMcpTools export object.
    // Add Liquidity Tools "AddAMMLiquidityTool": AddAMMLiquidityTool, "AddCLMMLiquidityTool": AddCLMMLiquidityTool, "AddStableLiquidityTool": AddStableLiquidityTool,
  • TappAgent.addAMMLiquidity method: generates transaction payload via Tapp SDK and submits it via Aptos client. Called by the tool handler.
    async addAMMLiquidity(params: AddAMMLiquidityParams): Promise<TransactionResponse> { try { const data = this.sdk.Position.addAMMLiquidity(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' }; } }
  • Complete McpTool object definition for tapp_add_amm_liquidity, including name, description, schema, and handler.
    export const AddAMMLiquidityTool: McpTool = { name: "tapp_add_amm_liquidity", description: "Add liquidity to an existing AMM pool", schema: { poolId: z.string().describe("The ID of the AMM pool"), amountA: z.number().describe("The amount of token A to add as liquidity"), amountB: z.number().describe("The amount of token B to add as liquidity") }, handler: async (agent: TappAgent, input: Record<string, any>) => { const result = await agent.addAMMLiquidity({ poolId: input.poolId, amountA: input.amountA, amountB: input.amountB }); return { status: "success", transaction: result }; }, };

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