Skip to main content
Glama

job_next

Read-onlyIdempotent

Retrieves the next queued job for a host when its lease is free, returning errors that identify lock holders or an empty queue.

Instructions

The head queued job for a host, only when that host's lease is free. Errors (with the holder) when a fresh lock blocks it, and when the host's queue is empty.

Input Schema

NameRequiredDescriptionDefault
host_idYesHost id from list_hosts, e.g. 'build-pc'

Output Schema

NameRequiredDescriptionDefault
idYes
kindYes
linksNo
phaseNo
titleYes
eventsNo
originNoWho asked for this run (human | agent | driver | eval | probe | warmup) — scopes the learning loopagent
paramsNoIntake: purpose, expected, caps, flags, pending_shot, ...
statusYes
targetYes
workerNo
host_idNoNULL = not yet assigned (host_choice='ask')
summaryNoPresent once the job is closed out
web_urlNoAbsolute URL of this job's page in the web UI
positionNo
artifactsNo
created_atYes
project_idNo
started_atNo
updated_atYes
crash_countNocrash-level events (the queue board flags these)
error_countNoerror-level events (the queue board flags these)
finished_atNo
current_stepNoThe step awaiting a verdict (newest prompt event + whether it is answered)
requested_byNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/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, and the description adds genuinely new behavior: it errors when a fresh lock is held (including the holder) and when the queue is empty. That is useful failure-mode context beyond the annotations; only the return shape is left unstated, which the output schema covers.

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?

Two tight sentences, with the core behavior front-loaded and the error conditions following. Every clause carries information about preconditions or failure modes; nothing is redundant.

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?

With annotations covering safety/idempotency and an output schema covering return values, the description supplies the missing pieces: the lease precondition and both error paths. Minor gap: it never clarifies in prose that the call does not claim or dequeue the job, leaving that inference to the readOnlyHint.

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?

There is a single parameter with 100% schema coverage, including an example value and a pointer to list_hosts. The description adds no parameter-level meaning, so the baseline of 3 applies since the schema carries the burden.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description names a specific resource and scope: 'the head queued job for a host', which distinguishes it from job_list (all jobs) and job_get (a specific job). It stops short of explicitly naming those siblings, so the differentiation is inferable rather than stated.

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

Usage Guidelines3/5

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

The precondition 'only when that host's lease is free' implies when to call it, and the error conditions hint at when not to. But there is no explicit routing guidance against job_list, job_get, job_assign, or job_start, leaving the agent to infer which tool retrieves versus claims work.

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