Skip to main content
Glama

get-top-selling-collections

Retrieve top-performing NFT collections on Magic Eden testnet based on sales volume and transactions for specific time periods using Monad NFT Analytics MCP.

Instructions

Retrieve top selling NFT collections on Magic Eden testnet

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
periodYesMagic Eden user address on Monad testnet

Implementation Reference

  • The handler function that implements the 'get-top-selling-collections' tool logic: fetches data from Magic Eden API, sorts collections by sales count, and returns formatted text output.
    async ({ period }) => { const url = `https://api-mainnet.magiceden.dev/v3/rtp/monad-testnet/collections/trending/v1?period=${period}&limit=50&sortBy=sales&normalizeRoyalties=false&useNonFlaggedFloorAsk=false` try { const res = await fetch(url); if (!res.ok) { throw new Error(`MagicEden API error: ${res.status} ${res.statusText}`); } const data = (await res.json()) as { collections: Array<{ name: string; count: number }> }; // Sort by number of sales (count) and build output lines const lines = data.collections .sort((a, b) => b.count - a.count) .map(item => `${item.name}: ${item.count} sales`); const output = lines.join("\n"); return { content: [ { type: "text", text: output, }, ], }; } catch (err) { const msg = err instanceof Error ? err.message : String(err); return { content: [ { type: "text", text: `Failed to fetch trending collections : ${msg}`, }, ], }; } }
  • Zod schema for the tool input parameter 'period' (string, though description incorrectly mentions address).
    { period: z.string().describe("Magic Eden user address on Monad testnet"), },
  • Registration of the 'get-top-selling-collections' tool on the MCP server, including name, description, input schema, and handler reference.
    server.tool( "get-top-selling-collections", "Retrieve top selling NFT collections on Magic Eden testnet", { period: z.string().describe("Magic Eden user address on Monad testnet"), }, async ({ period }) => { const url = `https://api-mainnet.magiceden.dev/v3/rtp/monad-testnet/collections/trending/v1?period=${period}&limit=50&sortBy=sales&normalizeRoyalties=false&useNonFlaggedFloorAsk=false` try { const res = await fetch(url); if (!res.ok) { throw new Error(`MagicEden API error: ${res.status} ${res.statusText}`); } const data = (await res.json()) as { collections: Array<{ name: string; count: number }> }; // Sort by number of sales (count) and build output lines const lines = data.collections .sort((a, b) => b.count - a.count) .map(item => `${item.name}: ${item.count} sales`); const output = lines.join("\n"); return { content: [ { type: "text", text: output, }, ], }; } catch (err) { const msg = err instanceof Error ? err.message : String(err); return { content: [ { type: "text", text: `Failed to fetch trending collections : ${msg}`, }, ], }; } } );

Other Tools

Related Tools

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/Sifu213/monad-mcp-magiceden'

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