Skip to the content

Capsid menu

capsid_work_jobs

Work the job queue, on Capsid. Needs a grant that depends on the action.

Can change or removeReaches GitHub or Cloudflare

What it does

The work queue. Each job mirrors to <namespace>/jobs/<id>.md. list needs the read grant; every other action needs the write grant. "Seat" below means the admin or a can_merge caller. Full rules: docs/work-queue.md.

What a client is told

The MCP hints it carries, so a client can ask before it acts (src/tool-annotations.ts).

Arguments

The arguments of capsid_work_jobs
ArgumentTypeNeededWhat it is
actionone of: post, list, claim, complete, record, fail, block, resume, supersede, release, begin, fire, routine, edit, park, unparkalwayspost | list | claim | complete | record | fail | block | resume | supersede | release | begin | fire | routine | edit | park | unpark.
namespacestringnoFor post, the namespace the work belongs to. For list and claim, the namespace to filter or pick from. For routine, the namespace whose routine is read or set.
titlestringnoFor post and edit: the title. One open job per (namespace, title).
bodystringnoFor post and edit: the full prompt the driver executes. Signed on the way in.
prioritywhole numbernoFor post and edit: higher runs first. Defaults to 0 at post.
gate_requiredbooleannoFor post and edit: the work needs a human confirmation (a push, a deploy, a secret).
review_requiredbooleannoFor post: complete and block on a job carrying a pull request are refused until a PR comment starts 'REVIEW:' and ends APPROVE, CHANGES or BLOCK; the newest counts. APPROVE must quote the current head sha (at least 7 hex characters). CHANGES sends the job back and spends a correction; BLOCK blocks it with the objection as the reason.
required_flagslist of one of: can_merge, can_direct_write, can_dispatch, can_write_workflows, can_touch_protected, money_paths, can_comment_prnoFor post: the flags the claiming driver must hold (can_merge, can_direct_write, can_dispatch, can_write_workflows, can_touch_protected, money_paths, can_comment_pr). The claim refuses an agent without them and leaves the job queued.
min_recordobjectnoFor post: the minimum merged pull requests on the claiming agent's record. The claim refuses an agent below it and leaves the job queued.
kindone of: watcher, design, security, build, maintenance, docs, mechanical, othernoFor post: the job's kind (watcher, design, security, build, maintenance, docs, mechanical, other). Optional: when absent Capsid reads it from the poster and the title. The kind and the job's risk decide the model Capsid recommends; nobody names a model.
statusstringnoFor list: one of queued | claimed | done | failed | blocked | superseded | parked.
viewone of: plan, digest, modelsnoFor list: "plan" returns the overnight plan, per repo the queued jobs in priority order that fit about 8 hours, gated ones included and marked gated (the session does the ordinary work and lists each risky step in its pull request), parked ones never, with what was skipped and why (a hand-started session can follow it); "digest" returns the morning digest, the pull requests ready, what blocked and why, and each job's usage. "models" returns what the model routing has learned: per job kind and model, the share merged with green CI, corrections and cost, with the rule changes the evidence supports and each trial arm's verdict against its kind's rule (never applied). All three are read-only. A caller scoped to one namespace names it; the plan is built over every namespace and narrowed to the one named.
stalebooleannoFor list: true returns the stale view, the blocked and claimed jobs that look stuck, each with rule (unchanged | resumed-not-completed | prs-settled | steps-seen) and a one-line reason. Read-only and costs no GitHub reads. Refused with view, status or id, and on any other action.
sincestringnoFor list with view "digest": the ISO time to report from. Defaults to the last 24 hours.
idstringnoThe job id: optional for claim, required for complete, fail, block, resume, supersede, release, begin, fire, edit, park and unpark. For list, narrows to that job, with its body for a caller holding write.
result_summarystringnoFor complete: what happened, in one sentence.
result_refstringnoFor complete: where the work landed, a document key or a PR URL.
reasonstringnoFor fail and block: why. For resume: what was approved, in one line; recorded in the audit row and returned as resume_note. For supersede: why the job was replaced or withdrawn. For park: one line saying when the job comes back. For release: why the holder is not coming back.
notestringnoFor resume: the full approval when it is longer than a line. Recorded in the audit row and returned as resume_note.note and in the mirrored document. reason is still required.
replaced_bystringnoFor supersede: the id of the replacing job, which must exist, be in the same namespace and not be this job. Omit it for a withdrawal.
commandstringnoFor block: the exact command the human must run.
routine_urlstringnoFor routine: the namespace's fire URL, https://api.anthropic.com/v1/claude_code/routines/trig_.../fire, or "off" to clear it. Omit it to read the routine.
questionbooleannoFor block: true when the session needs an answer, not a command run. reason is the question; the Worker fixes the command as 'Answer in a resume note' (a command sent with it is refused). The job is marked a question in capsid_run_improve action status and the Portal's feed, and the seat answers with resume and a note, which every later claim and list for the job returns.
approved_by_policystringnoFor resume: the signed gate policy version (capsid/policy/gates.md) the approval is made under. The blocked command must match a policy class (an additive migration, a branch push, opening a pull request) or the resume is refused. The admin or a can_merge caller may approve any class; a driver only its own job, and only a branch push or a pull request.
takebooleannoFor resume: the caller takes the claim instead of the driver that blocked the job. Runs every check a claim runs.
correctionbooleannoFor resume: sends the work back to be corrected and spends one correction. A plain resume or an admin resume spends none.
evidenceobject or stringnoFor complete: what the work produced, as an object or a JSON string. An omitted field is stored as NULL, not 0. For each named pull request the stored merge state, commit count and file count are read from GitHub; tests_added is stored as given.
claimobject or stringnoFor complete, fail and block: what the agent says it did, as an object or a JSON string. prs_opened and prs_merged (pull request URLs), tests {run, passed, failed, result: pass|fail|partial|not_run}, deploy_state (none|pending|deployed|verified|failed), files_touched (paths), usage {cost_usd, active_seconds, tokens {input, output, cache_read, cache_creation}} for this session only (self-reported), versions {model_id, client_name, client_version, permission_mode} (self-reported). Recorded as sent, apart from what the Worker verifies. An omitted field is NULL, never 0; an unknown key or a string that is not JSON is refused.