Generate commission statements
generate_commission_statementsUse this when the user wants commission statements for several reps, asks "how much commission did each rep earn this month", or attaches a deals export (CSV or Excel from a CRM or spreadsheet with rep, deal, amount, margin, close date, status columns; columns are matched automatically). Applies one plan to all reps (with per-rep quota, draw and prior balance overrides), handles split deals, SPIFFs, clawbacks, caps and draws, and returns a team summary, a commission statement PDF with one section per rep, and an Excel workbook listing each deal line. Does not compute taxes, withholding or take-home pay, and does not read PDF or image files. Do not use for a single quick commission question (use calculate_commission).
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"plan": "<plan>"
},
"name": "generate_commission_statements"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file | No | The deals export to read, CSV or Excel (.xlsx), e.g. september-deals.csv, with one deal per row. | |
| plan | Yes | One plan applied to all reps (per-rep quota, draw and balance go in rep_overrides), e.g. {"rate":8,"clawback_window_days":90}. | |
| deals | No | Typed deals when there is no file, each with rep (or splits), e.g. [{"rep":"Ana","deal":"Acme","amount":30000},{"deal":"Globex","amount":20000,"splits":[{"rep":"Ana","percent":60},{"rep":"Ben","percent":40}]}]. | |
| currency | No | ISO currency code, default USD, e.g. CAD or EUR. | |
| rep_name | No | Rep to credit when the file has no rep column, e.g. "Maria Lopez". | |
| column_map | No | Only if automatic matching picks the wrong column: file header per field, e.g. {"amount":"Net Revenue","rep":"Opportunity Owner"}. | |
| period_end | No | Last day of the period, e.g. 2026-09-30. | |
| sheet_name | No | Excel sheet to read, e.g. "Closed Won". Default: the first sheet with an amount column. | |
| company_name | No | Company name printed on the statements, e.g. "Acme Corp". | |
| period_label | No | Label printed on statements, e.g. "September 2026" or "Q3 2026". | |
| period_start | No | First day of the commission period, e.g. 2026-09-01. Deals closed outside the period are not counted. | |
| rep_overrides | No | Per-rep quota, target variable, draw or prior balance, e.g. [{"rep":"Ana","quota":120000,"draw_amount":2000}]. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | Yes | ||
| reps | Yes | ||
| team | Yes | ||
| notes | Yes | ||
| period | Yes | ||
| source | Yes | ||
| currency | Yes | ||
| downloads | Yes | ||
| reps_total | Yes | ||
| columns_used | Yes |