get_program_analytics
Analyze loyalty program performance to track engagement, rewards distribution, and participant activity metrics.
Instructions
Get analytics for your loyalty programs
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- The `get_program_analytics` tool is registered and implemented in the `supabase/functions/loyalty-mcp/index.ts` file. It queries the `merchant_analytics` table for the merchant associated with the agent's owner address.
mcpServer.tool("get_program_analytics", { description: "Get analytics for your loyalty programs", inputSchema: { type: "object" as const, properties: {} }, handler: async () => { const err = authGuard(["read"]); if (err) return T(err); const { data, error } = await db().from("merchant_analytics").select("*").eq("merchant_address", agent.ownerAddress); if (error) return T(JSON.stringify({ error: error.message })); return T(JSON.stringify({ analytics: data || [] })); }, });