pipeline_review
Review CRM pipeline health with revenue totals, stalled deals, per-stage breakdowns, win rate, and a verdict. Filter by salesperson, team, or company.
Instructions
Report the health of the CRM pipeline, in one call.
Composes open crm.lead opportunities into totals (count, expected and probability-weighted revenue), stalled deals (no stage change in stalled_days), close-date buckets, per-stage / per-salesperson breakdowns, the recent win rate, and a rule-based verdict.
Args: salesperson: Optional filter on user_id.name (ilike). team: Optional filter on team_id.name (ilike). stalled_days: Days without a stage change before a deal counts as stalled (default 14). lookahead_days: Days ahead that count as "closing soon" (default 30). win_rate_days: Look-back window for the won/lost ratio (default 90). top_n: Max stalled deals listed in the breakdown (default 5). timezone_offset: UTC offset for "today" (default 7 = Asia/Ho_Chi_Minh). company: Optional company name (ilike) or id; scopes every count and total to that company. stalled_pct_at_risk: Stalled share (%) at which the verdict drops to at_risk (default 25). stalled_pct_off_track: Stalled share (%) at which the verdict drops to off_track (default 50).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| team | No | ||
| top_n | No | ||
| company | No | ||
| salesperson | No | ||
| stalled_days | No | ||
| win_rate_days | No | ||
| lookahead_days | No | ||
| timezone_offset | No | ||
| stalled_pct_at_risk | No | ||
| stalled_pct_off_track | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |