Skip to main content
Glama

Calculate hours worked

calculate_hours
Read-onlyIdempotent

Use 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

NameRequiredDescriptionDefault
entriesYesOne 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}].
currencyNoISO currency code for pay amounts, default USD, e.g. EUR or GBP.
roundingNoPunch 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_periodNoOptional pay period label printed on the timesheet, e.g. "Sep 28 - Oct 11, 2026" or "Week 40".
hourly_rateNoOptional 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_dayNoFirst day of the workweek for dated entries, e.g. "sun". Default: the weekday of the earliest date.
overtime_presetNoOvertime 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_ruleNoCalifornia 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_multiplierNoOvertime pay multiplier, default 1.5.
double_time_multiplierNoDouble-time pay multiplier, default 2.
daily_overtime_after_hoursNoOverride the daily overtime threshold in hours, e.g. 8 (Alaska, Nevada) or 12 (Colorado). 0 turns daily overtime off.
weekly_overtime_after_hoursNoOverride the weekly overtime threshold in hours, e.g. 40 or 37.5. 0 turns weekly overtime off.
daily_double_time_after_hoursNoOverride the daily double-time threshold in hours, e.g. 12. 0 turns double time off.

Output Schema

NameRequiredDescriptionDefault
payYes
daysYes
noteYes
weeksYes
totalsYes
settingsYes
warningsYes
downloadsYes
pay_periodYes
assumptionsYesReadings of ambiguous clock times (no am/pm) that the user should confirm; empty when none.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, destructiveHint=false, so the safety profile is covered; the description adds genuine behavior beyond that — ambiguous times are resolved and surfaced in `assumptions` for confirmation, and warnings (overlapping punches, missing clock-out, >16 h shifts) are emitted. It does not discuss limits like entries cap or rate limits in prose, but the schema carries the caps, so this is strong rather than exhaustive.

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?

The trigger is front-loaded in the first clause and the rest is dense but non-redundant: capabilities, then return values, then exclusions. It is a long single paragraph, and the capability list could be tightened, but no sentence is filler.

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?

For a 13-parameter, high-complexity tool the description covers inputs, ambiguity handling, outputs (per-day H:MM and decimal, OT/DT split, totals, warnings, CSV/PDF links), and scope boundaries. An output schema exists, yet the summary of returns still helps the agent set user expectations.

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?

With 100% schema coverage the baseline is 3, but the description contributes extra semantics the schema does not spell out: pass times as written, ambiguous "9 to 5" is resolved and echoed back, and break minutes must not be double-counted as a punch gap. Rounding and overtime presets are named with the same vocabulary as the enums, aiding selection.

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?

The opening sentence names the specific resource (time card / hours worked calculator) and enumerates the exact computation scope: clock-in/out totals, breaks, multi-punch days, overnight shifts, rounding, overtime splits, gross pay. An agent can immediately tell this is a payroll-hours calculator, not a generic time utility.

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?

It gives an explicit trigger ("Use this when the user wants a time card calculator") plus explicit exclusions: no taxes/take-home pay, no legal advice, no live tracking or reminders, and "Do not use for simple unit conversions without clock times." That is a rare, complete when/when-not statement.

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