Skip to main content
Glama

tapp_create_amm_pool_and_add_liquidity

Create an Automated Market Maker (AMM) pool and provide initial liquidity by specifying token addresses, fee structure, and token amounts for decentralized trading on Tapp Exchange.

Instructions

Create an AMM pool and add initial liquidity

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
amountsYesThe initial token amounts
feeYesThe fee traders will pay to use your pool's liquidity
tokenAddressYesAn array of token addresses

Implementation Reference

  • The MCP tool handler function that validates input, calls the TappAgent method, and returns the transaction result.
    handler: async (agent: TappAgent, input: Record<string, any>) => { const result = await agent.createAMMPoolAndAddLiquidity({ tokenAddress: input.tokenAddress, fee: input.fee, amounts: input.amounts }); return { status: "success", transaction: result }; },
  • Zod schema defining the input parameters for the tool: token addresses, fee, and initial amounts.
    schema: { tokenAddress: z.array(z.string()).describe("An array of token addresses"), fee: z.number().describe("The fee traders will pay to use your pool's liquidity"), amounts: z.array(z.number()).describe("The initial token amounts") },
  • src/mcp/index.ts:38-38 (registration)
    The tool is registered in the TappExchangeMcpTools object, imported from liquidity-tools.
    "CreateAMMPoolAndAddLiquidityTool": CreateAMMPoolAndAddLiquidityTool,
  • TappAgent method that generates the transaction payload using the Tapp SDK and submits it via Aptos client.
    async createAMMPoolAndAddLiquidity(params: CreateAMMPoolAndAddLiquidityParams): Promise<TransactionResponse> { try { const data = this.sdk.Position.createAMMPoolAndAddLiquidity(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