Calculate hours worked
calculate_hoursUse this when the user wants a time card calculator or hours worked calculator: totaling clock-in/clock-out times for a day, week, or biweekly period, with lunch breaks, multiple in and out punches per day, overnight shifts, 12-hour or 24-hour (military) time, punch rounding (nearest 5/6/15 minutes or the 7-minute rule), overtime and double time per workweek (US federal 40 h, California daily rules, or custom), and gross pay from an hourly rate. Pass times as the user wrote them; times without am/pm ("9 to 5") are resolved and the reading is returned in assumptions for the user to confirm. Returns per-day hours in H:MM and decimal, regular/overtime/double-time split, totals, exact gross pay, warnings (overlapping punches, missing clock-out, shifts over 16 h), and CSV and printable PDF timesheet links. Does not compute taxes or take-home pay, give legal advice about breaks or overtime, track time live, or set reminders. Do not use for simple unit conversions without clock times.
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": {
"entries": "<entries>"
},
"name": "calculate_hours"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| entries | Yes | One item per worked day (up to 62, e.g. a biweekly or monthly time card). Example: [{"day":"Mon","punches":[{"start":"8:45","end":"17:30"}],"unpaid_break_minutes":30}]. | |
| currency | No | ISO currency code for pay amounts, default USD, e.g. EUR or GBP. | |
| rounding | No | Punch rounding applied to each clock-in and clock-out: none (default), nearest_5, nearest_6 (tenth of an hour), nearest_15, or seven_minute_rule (8:07 -> 8:00, 8:08 -> 8:15). | |
| pay_period | No | Optional pay period label printed on the timesheet, e.g. "Sep 28 - Oct 11, 2026" or "Week 40". | |
| hourly_rate | No | Optional regular hourly pay rate in the chosen currency for gross pay, e.g. 18.50 (USD) or 1100 (JPY). Leave out for hours only. | |
| week_start_day | No | First day of the workweek for dated entries, e.g. "sun". Default: the weekday of the earliest date. | |
| overtime_preset | No | Overtime rule set. us_federal (default): over 40 h per workweek at 1.5x. california: over 8 h/day and 40 h/week at 1.5x, over 12 h/day at 2x, plus the 7th-consecutive-day rule. none: no overtime split. | |
| seventh_day_rule | No | California 7th-consecutive-day rule: on the 7th straight workday of a workweek the first 8 h are overtime and the rest double time. Default on for california, off otherwise. | |
| overtime_multiplier | No | Overtime pay multiplier, default 1.5. | |
| double_time_multiplier | No | Double-time pay multiplier, default 2. | |
| daily_overtime_after_hours | No | Override the daily overtime threshold in hours, e.g. 8 (Alaska, Nevada) or 12 (Colorado). 0 turns daily overtime off. | |
| weekly_overtime_after_hours | No | Override the weekly overtime threshold in hours, e.g. 40 or 37.5. 0 turns weekly overtime off. | |
| daily_double_time_after_hours | No | Override the daily double-time threshold in hours, e.g. 12. 0 turns double time off. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pay | Yes | ||
| days | Yes | ||
| note | Yes | ||
| weeks | Yes | ||
| totals | Yes | ||
| settings | Yes | ||
| warnings | Yes | ||
| downloads | Yes | ||
| pay_period | Yes | ||
| assumptions | Yes | Readings of ambiguous clock times (no am/pm) that the user should confirm; empty when none. |