Skip to main content
Glama

get-top-selling-collections

Retrieve top-selling NFT collections on Magic Eden testnet to analyze market trends and identify high-volume performers by specifying a time period.

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 fetches top selling NFT collections from the Magic Eden API for the given period, sorts them by sales count, formats the output, and handles errors by returning text content.
    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 defining the input parameter 'period' as a string for the tool.
    { period: z.string().describe("Magic Eden user address on Monad testnet"), },
  • Registers the 'get-top-selling-collections' tool with the MCP server, providing the tool name and description.
    server.tool( "get-top-selling-collections", "Retrieve top selling NFT collections on Magic Eden testnet",
  • Initializes the MCP server instance declaring the 'top-selling-collections' capability.
    const server = new McpServer({ name: "monad-mcp-magiceden", version: "0.0.2", capabilities: ["top-selling-collections"], });

Other 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