zora_get_coin_swaps
Retrieve recent buy and sell swap activity for any coin on the Zora Coins ecosystem, enabling users 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:164-186 (registration)Registration of the 'zora_get_coin_swaps' MCP tool, including inline input schema validation and handler function that calls CoinsSDK.getCoinSwaps to fetch swap activity.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) }] }; } );
- src/index.ts:176-185 (handler)Handler function for 'zora_get_coin_swaps' tool: extracts parameters, calls CoinsSDK.getCoinSwaps API, and returns JSON-formatted response in MCP content format.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:166-174 (schema)Input schema and metadata for 'zora_get_coin_swaps' tool using Zod validation: requires coin address, optional chainId (defaults to Base), pagination params.{ 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(), },