Weekly Report
report_weeklyCompare weekly revenue and order changes, analyze customer segments, identify trending products, and receive AI-generated insights.
Instructions
Weekly trend report: revenue/order changes vs previous week, customer segment distribution, trending products, and AI-generated insights.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| store_id | Yes | UUID of a connected store (returned by store_connect with action="connect" or visible in store_connect with action="list" / the store_overview resource) |
Implementation Reference
- src/models/store.ts:228-250 (schema)Zod schema defining the WeeklyReport return type with fields: store_id, week_start/end, total_orders, total_revenue, avg_order_value, revenue/order change percent, top_segments, trending_products, insights, and summary.
export const WeeklyReportSchema = z.object({ store_id: z.string().uuid(), week_start: z.string(), week_end: z.string(), total_orders: z.number().int(), total_revenue: z.number(), avg_order_value: z.number(), revenue_change_percent: z.number(), order_change_percent: z.number(), top_segments: z.array(z.object({ segment: RFMSegmentSchema, count: z.number().int(), revenue: z.number(), })), trending_products: z.array(z.object({ title: z.string(), units_change: z.number().int(), trend: z.enum(['rising', 'stable', 'declining']), })), insights: z.array(z.string()), summary: z.string(), }); export type WeeklyReport = z.infer<typeof WeeklyReportSchema>;