Skip to main content
Glama
yurikaza
by yurikaza

Next work

next_work

Re-evaluate the dependency graph, budget, and policy to claim the next work: execute, wait for in-flight units, plan, or stop when complete or blocked.

Instructions

Re-evaluate the graph, budget and policy and claim the next work. action "execute" = do the dispatched units (direct, or parallel with subagents when justified); "wait" = finish in-flight units first; "plan" = analysis/graph needed; "stop" = the run is over (budget spent, waiting for human, blocked, or completed). Call after every report_work. Only "stop" ends an OUTSIDE_MODE run.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sessionIdYesSession handle returned by start_session.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
modeYes
stateYes
actionYes
budgetYes
dispatchNo
guidanceYes
inFlightYes
sessionIdYes
stopReasonNo
openDecisionsYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already signal a non-read-only, non-idempotent operation, so the description is not required to prove mutation. It adds value by defining the state-transition semantics of each action and the critical rule that only 'stop' terminates an OUTSIDE_MODE run. No contradiction with annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Every sentence earns its place: the purpose, all four action semantics, call cadence, and termination rule fit in a compact description. The key claim is front-loaded and the action definitions are efficiently packed.

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 one documented parameter, a true output schema, and the action semantics explained, an agent has enough to call next_work correctly. Minor ambiguity remains around terms like 'dispatched units' and 'policy,' but these do not block correct invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% and the sole parameter sessionId is already described as 'Session handle returned by start_session.' The description adds no parameter-specific information, so it sits at the baseline for high schema coverage.

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?

Description opens with a clear, specific action: 'Re-evaluate the graph, budget and policy and claim the next work.' It then unpacks the four action values (execute, wait, plan, stop) with concrete meanings, which disambiguates it from lifecycle siblings like report_work and get_phase.

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?

States an explicit call condition: 'Call after every report_work.' It also clarifies the terminal condition: 'Only "stop" ends an OUTSIDE_MODE run.' It does not name alternatives or exclusions, so it isn't a 5, but the timing guidance is clear.

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