Skip to main content
Glama

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
NameRequiredDescriptionDefault
addressYes
chainIdNo
afterNo
firstNo

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) }] };
      }
    );
  • 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) }] };
    }
  • 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(),
      },

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/r4topunk/zora-coins-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server