list_loyalty_programs
Retrieve all loyalty programs managed by your merchant on the Base L2 blockchain, including optional expired programs for comprehensive oversight.
Instructions
List loyalty programs owned by the agent's merchant
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| include_expired | No | Include expired programs |
Implementation Reference
- The handler for 'list_loyalty_programs' queries the loyalty_programs table in Supabase filtering by merchant_address.
mcpServer.tool("list_loyalty_programs", { description: "List loyalty programs owned by the agent's merchant", inputSchema: { type: "object" as const, properties: { include_expired: { type: "boolean", description: "Include expired programs" } } }, handler: async ({ include_expired }: any) => { const err = authGuard(["read"]); if (err) return T(err); let q = db().from("loyalty_programs").select("id,name,symbol,token_address,status,expiration_date,created_at").eq("merchant_address", agent.ownerAddress).order("created_at", { ascending: false }); if (!include_expired) q = q.neq("status", "expired"); const { data, error } = await q; if (error) return T(JSON.stringify({ error: error.message })); return T(JSON.stringify({ programs: data || [] })); },