UNPKG

uniderp-mcp

Version:

> A plug-and-play MCP tool server to **send ETH**, **transfer ERC-20 tokens**, **deploy tokens**, and **interact with smart contracts** on the **UNICHAIN** — built for **Claude Desktop**, **AI agents**, and **developers.**

41 lines (40 loc) 1.46 kB
import { z } from "zod"; import { getAccount } from "../config.js"; import { myPosition } from "../functions/uniswapMyPositionTool.js"; import { bigIntReplacer } from "../util.js"; export function registerUniswapMyPosition(server) { server.tool("View_Owned_Uniswap_Positions", "👜 View all uniswap positions in specific wallet address", { address: z .string() .optional() .describe("When querying the user's own wallet value, it is null"), }, async ({ address }) => { try { if (address === "" || !address || address === "null") { const account = await getAccount(); address = account.address; } const positions = await myPosition(address); return { content: [ { type: "text", text: `get user potitions successfully. ${JSON.stringify(positions, bigIntReplacer)}`, }, ], }; } catch (error) { const errorMessage = error instanceof Error ? error.message : String(error); return { content: [ { type: "text", text: `get user potitions failed: ${errorMessage}`, }, ], isError: true, }; } }); }