Skip to main content
Glama

Shift Scheduler

Build an optimized shift roster

build_shift_roster
Read-onlyIdempotent

Solve a staff rostering problem to optimality with a MILP solver and return who works which shift each day, coverage, unfilled posts, hours per person and warnings. Solves take 5-60 s. Pass either example (to solve a built-in example as-is) or the roster input fields. If the result has status 'running', call get_shift_roster_result with its job_id. Roster input. Minimal example: {"days": ["2026-10-05", "2026-10-06"], "shifts": [{"shift": "Day", "start": "07:00", "end": "19:00"}, {"shift": "Night", "start": "19:00", "end": "07:00", "night": "yes"}], "demands": [{"name": "RN", "penalty": 500}], "people": [{"name": "Ana", "cost": 40, "max_hw": 48}, ...], "grids": {"RN": {"2026-10-05|Day": 2, "2026-10-05|Night": 1}}, "parameters": {"MinRestHours": 11}}. Call get_shift_example for complete, realistic inputs.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
daysNoDay labels in order: ISO dates ('2026-10-05') or weekday names ('Mon'). Dates or weekdays enable weekend rules.
gridsNoOptional per-day/shift cells, keyed by a demand name or a person name, each an object keyed 'DAY|SHIFT'. Demand grid value = headcount required (demand with no grid = 1 on every shift). Person grid value: 'a' or 1 = available, 'f' = must work, 0 or missing = UNAVAILABLE (person with no grid = available everywhere).
peopleNo
shiftsNoShift types. A shift may cross midnight (end < start).
skillsNoWho can cover which demand. Omitted = everyone can cover every demand.
demandsNoPosts to fill (roles). Headcount per day/shift goes in grids.
exampleNoSolve this built-in example instead of passing the fields below.
parametersNoOptional rules. MinRestHours (11), MaxConsecutiveDays (6), MaxConsecutiveNights (4), ForbidDayAfterNight ('yes'), NightStartsAfter ('18:00'), MinBlockDays (1), WeekendFairnessPenalty (0), EquityPenalty (0) = even out total hours, NightEquityPenalty (0) = even out total nights (try 20), NightDifferential (1.0), WeekendDifferential (1.0), TimeLimitSeconds (max 120 here), GapPercent (2).
wait_secondsNoHow long to wait for the solve inside this call (default 25).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, and destructiveHint, so the safety profile is covered. The description adds useful behavioral context beyond annotations: solve duration (5-60 s), the asynchronous 'running' status, and the nature of the returned data. It does not address failure modes other than 'running', but it does not contradict the annotations.

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 description is front-loaded with the main purpose, then timing, then usage modes. The inline JSON example is lengthy but earns its place given the complex nested schema. No sentence is wasted, though the example could arguably be trimmed or referenced rather than fully inlined.

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

Completeness4/5

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

Given the tool's complexity and lack of an output schema, the description is quite complete: it states what the tool returns, how long it takes, how to handle async results, and how to get example inputs. It does not cover error scenarios beyond 'running', but the core invocation workflow is fully specified.

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 high (89%), so the schema already documents most parameters. The description adds value beyond the schema by explaining the either/or input mode (`example` vs. the roster fields) and providing a minimal example that illustrates how days, shifts, demands, people, grids, and parameters combine. This helps an agent assemble correct input without reading every schema field.

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 description opens with a specific action ('Solve a staff rostering problem to optimality') and a clear resource ('a shift roster'), and it lists concrete outputs: who works which shift, coverage, unfilled posts, hours per person, and warnings. It also differentiates itself from siblings by telling the agent when to call get_shift_roster_result and get_shift_example.

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?

The description explicitly states the two input modes: pass `example` for a built-in case or pass the roster input fields. It also gives a clear conditional: if status is 'running', call get_shift_roster_result with its job_id, and points the agent to get_shift_example for realistic inputs. This is actionable and distinguishes the tool from its alternatives.

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