evaluate_break_compliance
Analyze meal and rest period compliance for a duty day under a jurisdiction rule pack, returning premium hours owed, waiver issues, and rebuttable-presumption risk.
Instructions
Analyse meal & rest period compliance for a duty day under a jurisdiction rule pack. v0.1 ships the California pack (Labor Code §§ 226.7, 512; IWC wage orders). Returns per-meal/rest analysis, premium hours owed at the regular rate, waiver issues, and rebuttable-presumption risk per Donohue v. AMN.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| input | Yes | Raw inputs for the day under review. | |
| jurisdiction | Yes | Bundled jurisdiction rule pack to apply. Currently CA only; more arrive in subsequent minor versions. | |
| waivers | No |
Implementation Reference
- Tool handler: resolves the day input, then calls evaluateBreakCompliance from @attendance-engine/core with the resolved day, jurisdiction rule pack, and optional waivers. Returns both the resolved day result and the compliance analysis.
async ({ input, jurisdiction, waivers }) => { const result = resolveDay(input); const compliance = evaluateBreakCompliance({ result, rules: BREAK_RULE_SETS[jurisdiction], waivers: waivers ?? [], }); return { content: [jsonText({ result, compliance })] }; }, ); } - Tool input schema: 'input' (ResolveDayInputSchema), 'jurisdiction' (enum CA), and optional 'waivers' array with applies/date/signed/fileRef fields.
{ input: ResolveDayInputSchema.describe('Raw inputs for the day under review.'), jurisdiction: z .enum(['CA']) .describe('Bundled jurisdiction rule pack to apply. Currently CA only; more arrive in subsequent minor versions.'), waivers: z .array( z.object({ applies: z.enum(['first-meal', 'second-meal']), date: z.string().regex(/^\d{4}-\d{2}-\d{2}$/).optional(), signed: z.boolean(), fileRef: z.string().optional(), }), ) .optional(), }, - src/tools/evaluate-break-compliance.ts:11-41 (registration)Registration function exported as registerEvaluateBreakCompliance; registers the tool via server.tool() with name 'evaluate_break_compliance'.
export function registerEvaluateBreakCompliance(server: McpServer): void { server.tool( 'evaluate_break_compliance', "Analyse meal & rest period compliance for a duty day under a jurisdiction rule pack. v0.1 ships the California pack (Labor Code §§ 226.7, 512; IWC wage orders). Returns per-meal/rest analysis, premium hours owed at the regular rate, waiver issues, and rebuttable-presumption risk per Donohue v. AMN.", { input: ResolveDayInputSchema.describe('Raw inputs for the day under review.'), jurisdiction: z .enum(['CA']) .describe('Bundled jurisdiction rule pack to apply. Currently CA only; more arrive in subsequent minor versions.'), waivers: z .array( z.object({ applies: z.enum(['first-meal', 'second-meal']), date: z.string().regex(/^\d{4}-\d{2}-\d{2}$/).optional(), signed: z.boolean(), fileRef: z.string().optional(), }), ) .optional(), }, async ({ input, jurisdiction, waivers }) => { const result = resolveDay(input); const compliance = evaluateBreakCompliance({ result, rules: BREAK_RULE_SETS[jurisdiction], waivers: waivers ?? [], }); return { content: [jsonText({ result, compliance })] }; }, ); } - src/server.ts:38-38 (registration)Tool registration call: registerEvaluateBreakCompliance(server) in the createServer function.
registerEvaluateBreakCompliance(server); - src/util.ts:7-9 (helper)Helper function jsonText: serializes response data as pretty-printed JSON wrapped as an MCP text content block.
export function jsonText(value: unknown): { type: 'text'; text: string } { return { type: 'text', text: JSON.stringify(value, null, 2) }; }