Skip to main content
Glama

Calculate commission

calculate_commission
Read-onlyIdempotent

Use this when the user wants to calculate sales commission for one rep: a flat rate, a tiered commission ("5% up to 50k then 8% above"), quota attainment with accelerators or decelerators, a cap, a draw against commission, split deals ("split commission 60/40"), SPIFFs, clawbacks for refunded or cancelled deals, gross-margin commission, or OTE/target variable pay. Give either a sales_total or the deals. Returns the commission per deal with the tier applied, the tier breakdown, marginal and retroactive results when the plan does not say which, the draw recovery, the amount payable now, and a PDF commission statement plus an Excel file. Does not compute taxes or take-home pay. Do not use for a whole team or an uploaded deals file (use generate_commission_statements) or for commission-free trading.

Input Schema

NameRequiredDescriptionDefault
planYesThe commission plan terms: rate or tiers, quota, cap, draw, clawback rules, e.g. {"tiers":[{"up_to":50000,"rate":5},{"up_to":null,"rate":8}]}.
dealsNoThe rep's deals for the period, e.g. [{"deal":"Acme","amount":24000,"close_date":"2026-09-14"},{"deal":"Globex","amount":18000,"split_percent":60}].
currencyNoISO currency code, default USD, e.g. CAD or EUR.
rep_nameNoRep name for the statement, e.g. "Maria Lopez".
period_endNoLast day of the period, e.g. 2026-09-30.
sales_totalNoTotal credited sales for the period when there are no individual deals, e.g. 72000.
company_nameNoCompany name printed on the statement, e.g. "Acme Corp".
period_labelNoLabel printed on statements, e.g. "September 2026" or "Q3 2026".
period_startNoFirst day of the commission period, e.g. 2026-09-01. Deals closed outside the period are not counted.
prior_balanceNoUnrecovered draw or clawback balance owed from earlier periods, e.g. 1500.

Output Schema

NameRequiredDescriptionDefault
repYes
modeYes
notesYes
periodYes
currencyYes
downloadsYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.8/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnly/idempotent/non-destructive, and the description goes well beyond them: it discloses the mutual-exclusivity rule for sales_total vs deals, the fallback behavior of showing both marginal and retroactive results when the plan is silent, and the returned artifacts (per-deal commission, tier breakdown, draw recovery, payable-now, PDF statement, Excel file). That is substantive behavior an agent cannot infer from structured fields.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Long, but front-loaded with the trigger and the input rule, with exclusions last. The enumerated plan-feature list is somewhat dense yet each item corresponds to a real capability (tiers, draw, cap, SPIFF, clawback, OTE), so little is wasted.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given a 10-parameter nested-schema tool with an output schema, the description covers the trigger, required input combination, notable defaults (marginal vs retroactive both shown, bonuses outside cap), what is out of scope, and what is returned. Nothing an agent needs to select or call it correctly is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3. The description earns above baseline by surfacing the input-combination rule ('Give either a sales_total or the deals') and by naming the natural-language plan phrasings (e.g. "5% up to 50k then 8% above", "split commission 60/40") that map onto the tier/split parameters, adding meaning beyond per-field docs.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Opens with a specific verb and resource ('calculate sales commission for one rep') and enumerates the plan shapes it handles (flat, tiered, quota attainment, draw, split, SPIFF, clawback, gross-margin, OTE). It explicitly contrasts itself with generate_commission_statements for team/uploaded-file cases, so an agent can distinguish it from siblings without opening any schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

States when to use it ('when the user wants to calculate sales commission for one rep') and when not ('Do not use for a whole team or an uploaded deals file (use generate_commission_statements)', 'Does not compute taxes or take-home pay', 'not for commission-free trading'). The exclusion plus a named alternative satisfies the highest bar.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources