Skip to main content
Glama

Commit emergency insert + cascade reschedule

commitEmergencyReschedule

Atomically commit an emergency reschedule by inserting a priority job into a technician's route and rescheduling displaced jobs as previewed.

Instructions

Commit emergency insert + cascade reschedule

Applies the cascade previewed by /emergency/preview: assigns the emergency job to the technician and pushes the displaced jobs back (or, with displacement_mode=reassign, re-staffs them onto their previewed alternates first), atomically. Supports Idempotency-Key. The server recomputes the plan under a lock and fences each job on its status_version — if anything changed since the preview it returns 409 EMERGENCY_RESCHEDULE_PLAN_DRIFTED (re-preview). Same body as preview + optional emergency_expected_version. Isolated feature (see EMERGENCY_RESCHEDULE_DESIGN.md). 409 NEXT STEPS: EMERGENCY_RESCHEDULE_PLAN_DRIFTED — the schedule changed between your preview and this commit (another booking/move won a lane): call /preview again, show the fresh plan, then commit. EMERGENCY_RESCHEDULE_SLOT_OCCUPIED — landing window blocked by an immovable anchor (P0/crew/multi-day): another tech or time. Other codes — same remedies as /candidates.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modeYesCascade mode: overtime | next_day (must match the preview).
start_atYesDesired start — business-local naive datetime, no offset. Must be in the future and match the preview.
technician_idYesTarget technician (must belong to the business).
idempotency_keyNoUnique key making retries safe: a repeat send with the same key replays the original response (header Idempotent-Replayed: true) instead of re-running the operation. Reusing a key with a different body returns 422 IDEMPOTENCY_KEY_REUSE. (sent as the Idempotency-Key header)
emergency_job_idYesID of the P0 job to insert.
displacement_modeNoFate of displaced jobs: reschedule (default) or reassign — must match the preview.
expected_move_idsNoExpectedMoveIDs — the displaced job IDs the preview returned (echo BOTH data.days[].moves[].job_id AND data.reassignments[].job_id). RECOMMENDED: if the recomputed cascade would touch a different set (a job booked onto the lane since the preview), the commit is rejected with EMERGENCY_RESCHEDULE_PLAN_DRIFTED instead of displacing a job the coordinator never saw. Omit to opt out.
emergency_expected_versionNoOptimistic-lock fence from the previewed job (0 = fence on the server-read version).
Behavior1/5

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

Description claims it supports Idempotency-Key and replays original responses, implying idempotent behavior, but annotation idempotentHint=false contradicts this. Flagged as Annotation Contradiction.

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?

Front-loaded with purpose, but includes extensive detail on errors and next steps. Somewhat lengthy but necessary for clarity; well-structured.

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?

Comprehensive given no output schema: explains atomicity, locking, version fencing, error codes, and references design doc. All parameters fully described in schema.

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 100%, description adds extra context for expected_move_ids (recommended usage) and idempotency_key (header transmission). Adds value beyond schema.

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?

Clearly states it applies the cascade previewed by /emergency/preview, assigning the emergency job and displacing others. Differentiates from sibling previewEmergencyReschedule by being the commit step.

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?

Explicitly ties to preview step, provides error handling for 409 codes, and recommends using expected_move_ids to avoid plan drift. Gives clear next steps on failure.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/crisphive/crisphive-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server