zora_get_coin_swaps
Fetch recent buy and sell swap activity for any coin on the Zora Coins ecosystem to analyze trading patterns and market movements.
Instructions
Fetch recent buy/sell swap activity for a coin.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| address | Yes | ||
| chainId | No | ||
| after | No | ||
| first | No |
Implementation Reference
- src/index.ts:176-185 (handler)The handler function for the zora_get_coin_swaps tool. It takes input parameters, calls CoinsSDK.getCoinSwaps to fetch recent buy/sell swap activity for a coin, and returns the response as formatted JSON content.async ({ address, chainId, after, first }) => { // @ts-expect-error - TypeScript can't resolve barrel exports properly const resp = await CoinsSDK.getCoinSwaps({ address, chain: chainId, after, first, }); return { content: [{ type: "text", text: json(resp) }] }; }
- src/index.ts:169-174 (schema)Input schema using Zod for validating parameters: address (required string), chainId (optional number, defaults to Base chain), after (optional string for pagination), first (optional number 1-100 for limit).inputSchema: { address: z.string(), chainId: z.number().default(DEFAULT_CHAIN.id), after: z.string().optional(), first: z.number().int().min(1).max(100).optional(), },
- src/index.ts:164-186 (registration)Registration of the zora_get_coin_swaps tool with the MCP server, including title, description, input schema, and handler function.server.registerTool( "zora_get_coin_swaps", { title: "Get coin swaps", description: "Fetch recent buy/sell swap activity for a coin.", inputSchema: { address: z.string(), chainId: z.number().default(DEFAULT_CHAIN.id), after: z.string().optional(), first: z.number().int().min(1).max(100).optional(), }, }, async ({ address, chainId, after, first }) => { // @ts-expect-error - TypeScript can't resolve barrel exports properly const resp = await CoinsSDK.getCoinSwaps({ address, chain: chainId, after, first, }); return { content: [{ type: "text", text: json(resp) }] }; } );