Skip to main content
Glama

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. If it has status 'too_large', shorten the horizon or reduce people/shift types and retry. 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 60 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. Changed1 schema field changed
    • changedInput schema / properties / parameters / description
      Previous value: -"Optional 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)."New value: +"Optional 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 60 here), GapPercent (2)."
  2. First observed

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and idempotentHint=true, so the description's job is to add context. It does: it mentions solve time (5-60 s), the possibility of a 'running' status that requires fetching results later, and a 'too_large' status with retry guidance. This goes beyond the annotations and informs the agent of async behavior and failure modes. No contradiction with annotations is evident.

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 dense and purposeful. It front-loads the primary purpose, then timing, then usage instructions, and finally an example. Each sentence serves a function, and the inline minimal example is compact and illustrative. It is slightly long but not wasteful; every part earns its place.

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 (9 parameters, nested objects, no output schema), the description covers the essential usage points: what the tool does, the two input modes, timing, and how to handle async results and oversized problems. It lists the output types at a high level but not the exact structure, which is acceptable without an output schema. The description is sufficient for an agent to call the tool correctly and know what to expect.

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 89% schema description coverage, the baseline is 3. The description adds value by providing a minimal example that clarifies the structure of the input (days, shifts, demands, people, grids, parameters), and by explaining the two modes (example vs roster fields) and the semantics of status values. It doesn't repeat schema details but does give a concrete usage pattern, which helps the agent understand how parameters fit together.

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 states a specific verb ('Solve'), resource ('staff rostering problem'), and the expected outputs (who works which shift, coverage, unfilled posts, hours per person, warnings). It also differentiates from siblings by mentioning the two input modes (example vs roster fields) and referencing get_shift_roster_result for async results, which clearly distinguishes it from the getter and example tools.

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

Usage Guidelines4/5

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

The description gives explicit guidance on when to use this tool vs alternatives: it says to pass either 'example' or roster fields, and to call get_shift_roster_result if the status is 'running'. It also tells the user to call get_shift_example for complete inputs. While it doesn't explicitly state 'use this when you need to solve a roster', the context is clear. It lacks a comprehensive exclusion list but covers the key decision points.

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