Skip to main content
Glama
tamago-labs

Tapp Exchange MCP Server

by tamago-labs

tapp_get_pool_info

Retrieve detailed information about a specific liquidity pool by providing its ID, using the tool from Tapp Exchange MCP Server to support pool management and trading operations.

Instructions

Get detailed information about a specific pool by its ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
poolIdYesThe pool ID to get information for

Implementation Reference

  • The handler function for the 'tapp_get_pool_info' MCP tool, which retrieves pool information via the TappAgent and returns formatted response.
    handler: async (agent: TappAgent, input: Record<string, any>) => {
        const poolInfo = await agent.getPoolInfo(input.poolId);
        return {
            status: "success",
            pool: poolInfo
        };
    },
  • Zod schema defining the input parameter 'poolId' for the tool.
    schema: {
        poolId: z.string().describe("The pool ID to get information for")
    },
  • src/mcp/index.ts:28-28 (registration)
    Registration of the GetPoolInfoTool in the central TappExchangeMcpTools object.
    "GetPoolInfoTool": GetPoolInfoTool,
  • src/index.ts:20-52 (registration)
    Dynamic MCP server.tool() registration loop that registers 'tapp_get_pool_info' using its name, description, schema, and wrapped handler.
    for (const [_key, tool] of Object.entries(TappExchangeMcpTools)) {
        server.tool(tool.name, tool.description, tool.schema, async (params: any): Promise<any> => {
            try {
                // Execute the handler with the params directly
                const result = await tool.handler(agent, params);
    
                // Format the result as MCP tool response
                return {
                    content: [
                        {
                            type: "text",
                            text: JSON.stringify(result, null, 2),
                        },
                    ],
                };
            } catch (error) {
                console.error("error", error);
                // Handle errors in MCP format
                return {
                    isError: true,
                    content: [
                        {
                            type: "text",
                            text:
                                error instanceof Error
                                    ? error.message
                                    : "Unknown error occurred",
                        },
                    ],
                };
            }
        })
    }
  • TappAgent helper method called by the tool handler to fetch pool info from the SDK.
    async getPoolInfo(poolId: string): Promise<TappPool> {
        const info = await this.sdk.Pool.getInfo(poolId);
        return info;
    }

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