Skip to main content
Glama

Shift work: clock in

shiftwork_clock_in

Validates a shift-work checkpoint and returns one ready unit's brief for spawning an agent, checking readiness, path locks, and budget before work starts.

Instructions

Shift-work clock-in: validate the checkpoint against the checkpoint schema and return the brief of ONE unit — {unit, role, invariants, handoff, do_not, files} — to hand to the agent you spawn, verbatim. Call it once per unit, right before spawning; use shiftwork_plan first to see the ready batch when several units are to run at once, and shiftwork_clock_out, not this tool, when a unit finishes. The unit briefed is plan.cursor, or unit_id when given; either way it must be in shiftwork_plan's ready — a done or dropped cursor, a cursor whose dependencies have not run, or a unit_id naming no unit answers {"result": "error", "reason": "unit is not ready; ready is <a, b>"}, and the batch view's own refusals (cycle, unknown dependency, unreadable checkpoint) pass through verbatim. A ready unit whose touches shares a path with a unit briefed and not yet clocked out is refused too, before any brief: unit <id> touches <path>, which <other> holds until its clock-out. A checkpoint whose reviews break review independence is refused with shiftwork_plan's sentence. With job.budget declared, a brief that does not fit is refused: budget <dim> spent: <n> of <limit>; raise job.budget or stop the job. The other outcomes: escalate when handoff.open_questions is non-empty (stop and ask) or when the cursor names no unit, success when every unit is done or dropped, error when the checkpoint fails validation. It never moves plan.cursor; clock_out does. What it WRITES: on result=brief, and only then, one line {event: brief, ts, unit, role} appended to .log.jsonl — best-effort, so a log it cannot write costs the brief nothing. That line lets clock_out accept the unit while the cursor is elsewhere and sets briefed. The checkpoint file itself is never modified. A brief always carries hints {repair, review}, null when none (#310). See docs/shiftwork.md.

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": {
      "checkpoint": "<checkpoint>"
    },
    "name": "shiftwork_clock_in"
  }
}

Input Schema

NameRequiredDescriptionDefault
unit_idNoThe unit to brief instead of plan.cursor; it must be in shiftwork_plan's `ready` for this checkpoint. Omit it, or pass null, to brief the cursor unit.
checkpointYesPath to the shift-work checkpoint JSON file (by convention .shiftwork/checkpoint.json in the repo the job works on), absolute or relative to the server's working directory. The same file shiftwork_plan, shiftwork_clock_in and shiftwork_clock_out take; it must validate against assets/schemas/shiftwork-checkpoint.json.

Output Schema

NameRequiredDescriptionDefault
roleNoThe unit's role, the key job.roles may bind models to.
unitNoThe plan.units entry briefed: id, role, status, depends_on and its own fields.
filesNostate.artifacts: the files the job has produced so far.
hintsNoAlways present with a brief: {repair, review}. `repair` is null or {lever, owned, fast_check, use_when, call, write, fallback, skip_when, log}, set for an implementer unit with touches that a blocked reviewer rejected. `review` is null or {lever, thread, resumes_so_far, resume_allowed, members, turn, fresh_when, log}, set for a reviewer unit that has clocked out before; each member is {unit, changed, revision, fast_check, paths}. Advice only: nothing refuses ignoring it.
do_notNohandoff.do_not: near-mistakes past sessions made.
reasonNoWith result `escalate`, `success` or `error`: one sentence saying why.
resultYes`brief` (the unit is yours to spawn), `escalate` (stop and ask: see `reason` and `open_questions`), `success` (every unit done or dropped), or `error` with `reason`.
handoffNoThe checkpoint's handoff block: next_action, open_questions, do_not, notes.
upstreamNoOne {unit, title, status, last} per depends_on id, in depends_on order: last is that unit's newest attempt (status, outcome, notes?, produced?) or null. Always present with a brief.
agreementsNojob.agreements: the working agreements adopted so far through clock_out, carried on every brief; [] when none.
invariantsNojob.constraints: what every unit must keep true.
open_questionsNoWith result `escalate`: the questions the orchestrator must put to the user before any unit runs. An irreversible unit whose verb job.authorized does not grant also escalates (#225), with no open_questions.
prior_attemptsNoThis unit's own attempts, oldest first, at most 3; [] when none. A unit clocked out todo and briefed again is a rework, and this is what it found.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.40.0
    • addedOutput schema / properties / hints
      Added value: +{
      +  "description": "Always present with a brief: {repair, review}. `repair` is null or {lever, owned, fast_check, use_when, call, write, fallback, skip_when, log}, set for an implementer unit with touches that a blocked reviewer rejected. `review` is null or {lever, thread, resumes_so_far, resume_allowed, members, turn, fresh_when, log}, set for a reviewer unit that has clocked out before; each member is {unit, changed, revision, fast_check, paths}. Advice only: nothing refuses ignoring it.",
      +  "type": "object"
      +}
  2. Changed6 schema fields changedv0.38.0
    • addedOutput schema / properties / agreements
      Added value: +{
      +  "description": "job.agreements: the working agreements adopted so far through clock_out, carried on every brief; [] when none.",
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
    • changedOutput schema / properties / open_questions / description
      Previous value: -"With result `escalate`: the questions the orchestrator must put to the user before any unit runs."New value: +"With result `escalate`: the questions the orchestrator must put to the user before any unit runs. An irreversible unit whose verb job.authorized does not grant also escalates (#225), with no open_questions."
    • addedOutput schema / properties / open_questions / items / anyOf
      Added value: +[
      +  {
      +    "description": "A decision question.",
      +    "type": "string"
      +  },
      +  {
      +    "description": "A question with a kind (#225): {q, kind: relay|decision, probe}. Escalation happens only for a decision or a relay whose probe did not exit 0; an answered relay is logged as a `resolved` ledger event.",
      +    "type": "object"
      +  }
      +]
    • removedOutput schema / properties / open_questions / items / type
      Removed value: -"string"
    • addedOutput schema / properties / prior_attempts
      Added value: +{
      +  "description": "This unit's own attempts, oldest first, at most 3; [] when none. A unit clocked out todo and briefed again is a rework, and this is what it found.",
      +  "type": "array"
      +}
    • addedOutput schema / properties / upstream
      Added value: +{
      +  "description": "One {unit, title, status, last} per depends_on id, in depends_on order: last is that unit's newest attempt (status, outcome, notes?, produced?) or null. Always present with a brief.",
      +  "type": "array"
      +}
  3. Changed4 schema fields changedv0.36.2
    • addedInput schema / properties / checkpoint / description
      Added value: +"Path to the shift-work checkpoint JSON file (by convention .shiftwork/checkpoint.json in the repo the job works on), absolute or relative to the server's working directory. The same file shiftwork_plan, shiftwork_clock_in and shiftwork_clock_out take; it must validate against assets/schemas/shiftwork-checkpoint.json."
    • addedInput schema / properties / unit_id / description
      Added value: +"The unit to brief instead of plan.cursor; it must be in shiftwork_plan's `ready` for this checkpoint. Omit it, or pass null, to brief the cursor unit."
    • addedOutput schema / properties
      Added value: +{
      +  "do_not": {
      +    "description": "handoff.do_not: near-mistakes past sessions made.",
      +    "items": {
      +      "type": "string"
      +    },
      +    "type": "array"
      +  },
      +  "files": {
      +    "description": "state.artifacts: the files the job has produced so far.",
      +    "type": "array"
      +  },
      +  "handoff": {
      +    "description": "The checkpoint's handoff block: next_action, open_questions, do_not, notes.",
      +    "type": "object"
      +  },
      +  "invariants": {
      +    "description": "job.constraints: what every unit must keep true.",
      +    "items": {
      +      "type": "string"
      +    },
      +    "type": "array"
      +  },
      +  "open_questions": {
      +    "description": "With result `escalate`: the questions the orchestrator must put to the user before any unit runs.",
      +    "items": {
      +      "type": "string"
      +    },
      +    "type": "array"
      +  },
      +  "reason": {
      +    "description": "With result `escalate`, `success` or `error`: one sentence saying why.",
      +    "type": "string"
      +  },
      +  "result": {
      +    "description": "`brief` (the unit is yours to spawn), `escalate` (stop and ask: see `reason` and `open_questions`), `success` (every unit done or dropped), or `error` with `reason`.",
      +    "type": "string"
      +  },
      +  "role": {
      +    "description": "The unit's role, the key job.roles may bind models to.",
      +    "type": "string"
      +  },
      +  "unit": {
      +    "description": "The plan.units entry briefed: id, role, status, depends_on and its own fields.",
      +    "type": "object"
      +  }
      +}
    • addedOutput schema / required
      Added value: +[
      +  "result"
      +]
  4. First observedv0.36.0

TDQS

A4.8/5.0
Behavior5/5

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

Annotations only say readOnlyHint=false and destructiveHint=false. The description goes well beyond: on result=brief it appends ONE {event: brief, ts, unit, role} line to <checkpoint>.log.jsonl, that write is best-effort so a failed log costs nothing, and the checkpoint file itself is never modified. It also enumerates error/escalate/success outcomes and states that plan.cursor is never moved here. This is exactly the kind of write/side-effect disclosure annotations cannot carry.

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 and the core call pattern, and essentially every clause carries operative information (refusals, side effects, outcomes). It is, however, dense and long-winded — several run-on sentences chaining refusal cases — so it is not maximally scannable.

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?

Despite an output schema existing, the description still names the result values (brief, escalate, success, error) and their triggers, covers every refusal path, and documents the log side effect and cursor invariant. For a tool whose behavior hinges on checkpoint state, nothing an agent needs in order to call it correctly is missing.

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%, so baseline is 3. The description adds real meaning: the briefed unit is plan.cursor by default or `unit_id` when given, and either way it must appear in shiftwork_plan's `ready` or the call is refused with a specific error. That pre-condition is not in the schema's own param text and materially changes how unit_id should be chosen.

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?

States a specific verb (validate, return brief) and resource (shift-work checkpoint / one unit's brief), and explicitly names the sibling it is not: 'shiftwork_clock_out, not this tool, when a unit finishes.' The returned brief shape is spelled out ({unit, role, invariants, handoff, do_not, files}), so an agent knows exactly what it gets.

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?

Explicit sequencing (call once per unit right before spawning), an explicit alternative (use shiftwork_plan first for the `ready` batch when several units run at once), an explicit exclusion (clock_out when a unit finishes), and the full set of refusal conditions with their messages. Nothing is left to inference.

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