list_marketplace_offers
Browse active token trading offers on the Loyal Spark marketplace to discover available trades for loyalty program tokens.
Instructions
List active token trading offers on the marketplace
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| status | No | Filter: active/completed/cancelled | |
| limit | No | Max results (1-100) |
Implementation Reference
- The handler function for 'list_marketplace_offers' which queries the 'marketplace_offers' table in the database.
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)The registration of the 'list_marketplace_offers' tool within the MCP server implementation.
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 || [] })); }, });