tapp_get_positions
Retrieve a paginated list of liquidity positions for a specific user address on Tapp Exchange, enabling efficient tracking of decentralized exchange activities on the Aptos blockchain.
Instructions
Get a paginated list of liquidity positions for a user address
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| page | No | The page number for pagination (defaults to 1) | |
| size | No | The number of results per page (defaults to 10) | |
| userAddr | No | The user's wallet address to fetch positions for (defaults to current agent address) |
Implementation Reference
- src/mcp/tapp/position-tools.ts:13-28 (handler)MCP tool handler for 'tapp_get_positions': calls TappAgent.getPositions with input params and returns formatted response with pagination info.handler: async (agent: TappAgent, input: Record<string, any>) => { const positions = await agent.getPositions({ userAddr: input.userAddr, page: input.page || 1, size: input.size || 10 }); return { status: "success", positions, pagination: { page: input.page || 1, size: input.size || 10, total: positions.length } }; },
- src/mcp/tapp/position-tools.ts:8-12 (schema)Input schema validation using Zod for the tapp_get_positions tool parameters: userAddr (optional), page (optional), size (optional).schema: { userAddr: z.string().optional().describe("The user's wallet address to fetch positions for (defaults to current agent address)"), page: z.number().optional().describe("The page number for pagination (defaults to 1)"), size: z.number().optional().describe("The number of results per page (defaults to 10)") },
- src/mcp/index.ts:56-56 (registration)Registration of the GetPositionsTool (tapp_get_positions) in the central TappExchangeMcpTools export object."GetPositionsTool": GetPositionsTool,
- src/mcp/index.ts:23-23 (registration)Import of GetPositionsTool from position-tools.ts for registration in MCP tools.import { GetPositionsTool, CollectFeeTool } from "./tapp/position-tools";
- src/agent/index.ts:570-581 (helper)TappAgent.getPositions method called by the tool handler: resolves user address and delegates to SDK Position.getPositions.async getPositions(params: { userAddr?: string; page?: number; size?: number; }): Promise<TappPosition[]> { const userAddr = params.userAddr || await this.getAddress(); const positions = await this.sdk.Position.getPositions({ ...params, userAddr }); return positions; }