list_marketplace_offers
Retrieve active token trading offers from the loyalty program marketplace to view available trades and manage rewards.
Instructions
List active token trading offers on the marketplace
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| status | No | Filter: active/completed/cancelled | |
| limit | No | Max results (1-100) |
Implementation Reference
- The handler logic for the 'list_marketplace_offers' tool, which fetches data from the 'marketplace_offers' table in Supabase.
handler: async ({ status, limit }: any) => { const err = authGuard(); if (err) return T(err); const { data, error } = await db().from("marketplace_offers").select("*").eq("status", status || "active").order("created_at", { ascending: false }).limit(Math.min(limit || 50, 100)); if (error) return T(JSON.stringify({ error: error.message })); return T(JSON.stringify({ offers: data || [] })); }, - supabase/functions/loyalty-mcp/index.ts:202-212 (registration)Registration of the 'list_marketplace_offers' tool within the MCP server.
mcpServer.tool("list_marketplace_offers", { description: "List active token trading offers on the marketplace", inputSchema: { type: "object" as const, properties: { status: { type: "string", description: "Filter: active/completed/cancelled" }, limit: { type: "number", description: "Max results (1-100)" } } }, handler: async ({ status, limit }: any) => { const err = authGuard(); if (err) return T(err); const { data, error } = await db().from("marketplace_offers").select("*").eq("status", status || "active").order("created_at", { ascending: false }).limit(Math.min(limit || 50, 100)); if (error) return T(JSON.stringify({ error: error.message })); return T(JSON.stringify({ offers: data || [] })); }, });