Reference

MCP tools

Every tool the kraft MCP server serves, with its parameters and the kraft command that does the same.

kraft admin mcp serves these tools over stdio. The Kraft plugin registers it in the agent it is installed in, and kraft admin init registers it for Claude Code. For an agent without the plugin, see Register Kraft with your agent.

The tool names and parameters are a public interface: they keep their shape between minor releases. See Versioning and stability.

Same as the CLI

Each tool calls the same client function as its kraft command, and --json prints that function's payload, with three differences:

  • get_work_item returns a trimmed item (its status and display_status, current node, pending gate, attachments, progress, stop reason, usage, any policy override, any concerns a task raised about its own work, and next_node_id, and not its chain or sessions). kraft view show --json prints the full detail, with the effective chain, worker sessions and stop.
  • approve_gate, reject_gate, resume_work_item, retry_work_item, raise_budget, skip_work_item, complete_work_item and cancel_work_item answer as get_work_item does. The CLI's --json prints the item's whole row, with its frozen chain.
  • list_work_items lists every repo. kraft view list is scoped to the repo you are in unless --all or --repo says otherwise.

work_item_id is optional wherever a tool takes it. Left out, it is the work item whose worktree or session you are in.

A work item ID, there or in depends_on or dependency, may be the start of one: 4 characters or more that no other item's ID starts with. A worker session can't act on its own item by the start of its ID either.

Errors

A refused call is an error result whose text ends with the line the command prints, such as kraft: 404: unknown work item, so the agent can see why.

An argument the API can't read names the field and what is wrong with it: kraft: 422: label: Input should be 'must_fix', 'question' or 'nit'.

Who may call what

The last column of each table below, and the Human mark, say what an agent may do.

MarkMeaning
Human, in the What it does columnA decision the agent should ask a person about first.
refused, in the Own item columnThe tool fails when a Kraft worker aims it at the item it is running. The API behind it refuses the same call from a worker session.
API only: any item, in the Own item columnThe tool has no check of its own. The API refuses it from any Kraft session, on any item, as the second exception says.
A blank Own item cellA worker may use the tool on its own item.

Four exceptions:

  • An escalation turn isn't a worker, so neither the client nor the API refuses it the refused tools on the item it is helping with. Four are still refused to it: approve_gate, reject_gate, raise_budget and set_work_item_policy, because a gate and a spending cap are a person's call.
    In practice a turn can use retry_work_item on a needs_human item, which Kraft records and performs once the turn ends, complete_work_item, cancel_work_item, set_agent_overrides, and set_node_overrides for a node that hasn't started, except its extra_prompt. The API answers it 409 for these:
    • skip_work_item, resume_work_item and escalate_work_item, while any escalation turn is running, the caller's own included.
    • pause_work_item: a turn runs only on an item that is needs_human or paused, and pause takes only a running one.
    • set_attachments: a turn runs only on an item that has started, and a started item's documents are fixed.
  • On a disabled repo, or a workspace that selects a disabled member, the API refuses create_work_item, and resume_work_item for an item that has never started, from any Kraft session or MCP session: a person enables the repo in Settings › Repos first, since its commands run for every item.
  • The API refuses add_review_comment, submit_review, resolve_thread, reopen_thread, add_worker, edit_worker, rotate_worker_token, list_workers and remove_worker from any Kraft session, a worker or an escalation turn, on any item and not only its own.
  • kraft item abandon, item archive and item restore have no tool. A worker is refused abandon on its own item too.

Read

ToolWhat it doesParametersCommandOwn item
list_work_itemsLists work items. Abandoned and cancelled items show only when you ask for abandoned or cancelled. Each row carries display_status beside status.status: a stored or displayed status, not archived. A word both have, such as waiting, means the stored one.kraft view list
get_work_itemReturns the item, trimmed: see Same as the CLI.work_item_id.kraft view show
get_gate_artifactReturns the spec or plan the pending gate decides, and the digest a chain revision gate needs.work_item_id.kraft view artifact
get_attachmentReturns the spec or plan the item was filed with, as Kraft stored it then: readable before the item starts.kind (required: spec or plan), work_item_id.kraft view docs --attachment
searchSearches specs, plans and session summaries across repos.q (required), limit (default 20).kraft view search
list_threadsLists review threads, drafts included.work_item_id, open_only (default false).kraft view threads
forge_mrReturns the item's merge request as the forge has it. Errors until the item has one.work_item_id, repo (a workspace member's mount path).kraft view mrAdded in 2.5
forge_pipelinesLists the item's pipelines or workflow runs.work_item_id, repo.kraft view pipelinesAdded in 2.5
forge_jobsLists the jobs of one pipeline, by an ID from forge_pipelines.pipeline (required), work_item_id, repo.kraft view jobsAdded in 2.5
forge_job_logReturns the last lines of one job's log as {"log", "truncated"}.pipeline, job (required), work_item_id, lines (default 200, 1 to 5000), repo.kraft view job-logAdded in 2.5
forge_merged_mrsLists recently merged merge requests into the base branch.work_item_id, limit (default 20, 1 to 100), repo.kraft view mergedAdded in 2.5
forge_labelsLists the project's labels.work_item_id, repo.kraft view labelsAdded in 2.5
compare_changesCompares two review targets. A target is base, attempt:N, last_review or latest.work_item_id, from_ (default base), to (default latest), nodes (comma-separated node IDs), ignore_whitespace (default false).kraft view compare

File and connect

ToolWhat it doesParametersCommandOwn item
create_work_itemFiles the item paused. See Creating a work item.title (required), repo, chain, description, attachments, auto_gate (default true), implements_beads, depends_on, policy, base_branch, in_place, skip_nodes, budget_usd, node_overrides, runner, chain_yaml and chain_template. A node's extra_prompt in node_overrides is refused: a person sets it. Added in 2.4kraft item create
ensure_repoConnects the repo if it isn't connected yet. See Connecting a repo. A test_command ("" included) or a non-empty setup_command you pass saves the repo disabled, and the answer's held says why.path (default: the current directory), test_command, setup_command.kraft repo connect

Creating a work item

Some create_work_item parameters have a default or a shape:

  • repo defaults to the repo of the item you are in.
  • chain defaults to the repo's default_chain, else default. chain_template is its old name, still read; chain wins when both are given.
  • attachments is [{"kind": "spec" or "plan", "path": ...}], at most one of each. A path is resolved against the repo and against the working tree you are standing in, relative to that tree or absolute.
  • auto_gate defaults to true.
  • depends_on is work item IDs this item comes after. You still start it; started while one is unfinished it is blocked, and Kraft starts it when they complete. They can't be added later.
  • budget_usd sets a dollar cap. This tool can set a cap but not lift one.
  • runner is where the item's steps run: a machine or group from workers.yaml, any or local. It wins over the library's runner:.
  • in_place true runs the item in the repo's own checkout, false in a worktree. Unset, the repo's worktrees setting decides.

The tool warns, in repo_warning, when the repo declares no setup command or no test command, which would stop the item.

A call that files an item with a spec attached:

{"title": "fix the flaky test", "attachments": [{"kind": "spec", "path": ".engineering/specs/x.md"}]}

An attached document trims the node whose gate it satisfies, so nobody approves again what was already agreed.

Connecting a repo

When it connects a repo, ensure_repo proposes both commands from the repo's task runner, CI and lockfiles, or takes the ones given ("" for none). It returns every candidate it found.

Commands passed to the tool are an agent's choice, and they run for every work item on the repo, so a test_command ("" included) or a non-empty setup_command saves the repo disabled, and the answer carries held: saved disabled: an agent chose its commands, which run for every work item on it, so no agent files work on it until a person has read them and enabled it in Settings › Repos.

With no commands, or only setup_command: "", the repo connects with Kraft's own proposal, enabled when it found a test command. An already-connected repo is left as it is.

Filing a one-off chain

Added in 2.5

create_work_item and set_chain take chain_yaml: the YAML a chain file holds, used by this one item and never added to the library. If it has custom content (its own prompts, commands, tools or gates), a person must review it in the web UI before the item can start. These tools can't approve it.

Act on a work item

ToolWhat it doesParametersCommandOwn item
approve_gateApproves a pending gate. Human.work_item_id, gate (default: the pending one), digest (a chain revision gate needs it), head (the final review needs the review_head that get_work_item returned).kraft item approverefused
reject_gateRejects the pending gate and sends the chain back to work. Human.note (required), work_item_id, gate, node (where the chain re-enters).kraft item rejectrefused
pause_work_itemPauses the item and ends its running sessions. A queued item leaves the queue, back to where it was.work_item_id.kraft item pauserefused
unblock_work_itemDrops what a blocked or paused item still comes after, or only dependency. A blocked item with nothing left to wait for then starts on its own. Human. Added in 2.1work_item_id, dependency.kraft item unblockrefused
resume_work_itemStarts a paused item, including one just filed; its steer also answers a stop on an agent's question. Queues the item when every slot is busy, and blocks it when it comes after an unfinished item.work_item_id, steer, steers ({task path: steer}).kraft item resumerefused
retry_work_itemThe way back onto a stopped item. It doesn't reset a breached cap's counters, so an item that stopped on a cap stops again. Queues the item when every slot is busy.work_item_id, steer, path (node, node.step or node.step.task), restart (default false).kraft item retryrefused
raise_budgetRaises the dollar cap that stopped the item and retries it; queues the retry when every slot is busy. See Raising a dollar cap. Human.budget_usd (required; null for no cap), work_item_id.kraft item raise-budgetrefused
skip_work_itemAdvances past the current node or gate without running it. Human.work_item_id, note, path, head (the final review needs it).kraft item skiprefused
complete_work_itemEnds the item as completed. Human.reason (required), work_item_id, close_beads (default false).kraft item completerefused
cancel_work_itemEnds the item as cancelled. The worktree stays. Human.reason (required), work_item_id.kraft item cancelrefused
escalate_work_itemSends a message into the item's escalation thread.message (required), work_item_id.kraft item escalaterefused

Raising a dollar cap

raise_budget raises the item's own cap, or the item-wide budget_usd of its policy, which it merges into the item's policy override, keeping its other fields.

Any other cap's stop is refused. A node's budget_usd or a token_budget comes with a pointer to kraft item set-policy (here, set_work_item_policy), which replaces the whole override, so pass the fields it already has too. A stop on budget.daily_usd is refused too: raise it in policy.yaml, or wait for local midnight. kraft item raise-budget lists every refusal. See Raise a cap on a stopped item.

Change a work item's setup

These refuse with 409 once the item, or the node, has started, except the policy tool, which binds from the next node entered.

ToolWhat it doesParametersCommandOwn item
set_chainSwitches a not-yet-started item's chain.chain, chain_yaml (one of the two, see Filing a one-off chain), work_item_id. Added in 2.5kraft item set-chain
set_attachmentsRevises a not-yet-started item's spec or plan, or drops one.work_item_id, spec, plan (paths), drop (["spec"], ["plan"] or both).kraft item set-attachmentsrefused
set_agent_overridesSets the model and effort of every agent node. Replaces the whole override: a field you leave out goes back to the chain's own binding. A call that doesn't name runner keeps the stored one.work_item_id, model, escalate_model, effort, runner (a machine or group, any or local), clear (default false). Added in 2.4kraft item set-overridesrefused
set_node_overridesSets one node's agent overrides. extra_prompt is refused: a person sets it. clear is the only way this tool drops one, and it resets the node.node_id (required), work_item_id, auto_escalate, auto_escalate_stuck, auto_escalate_delay_s, model, effort, extra_prompt, reviewers, runner, clear (default false). runner also works on a started node. reviewers is a list of {"bot": LOGIN} or {"check": NAME}; [] expects none. Added in 2.4kraft item set-node-overriderefused
set_work_item_policyGives the item its own policy override. Replaces the whole stored override.work_item_id, policy (item-wide fields, plus paths for per-scope fields; item-wide budget_usd may be "none", no dollar cap), clear (default false).kraft item set-policyrefused

Review

ToolWhat it doesParametersCommandOwn item
add_review_commentLeaves a draft comment. See Review comment parameters.body (required), work_item_id, thread_id (to reply), file_path, start_line, end_line, side, start_side, quote, label, suggestion.kraft item commentrefused
resolve_threadResolves a review thread.thread_id (required).kraft item resolveAPI only: any item
reopen_threadReopens a resolved review thread.thread_id (required).kraft item reopenAPI only: any item
submit_reviewSends the drafts. Human.outcome (required: comment, request_changes or approve), work_item_id, summary, node, head (an approve at the final review needs it).kraft item reviewrefused

Review comment parameters

  • side is old or new, default new: end_line's side.
  • start_side is start_line's side, when the range crosses sides.
  • quote is the range's lines, each led by its diff mark; left out, Kraft quotes them from the diff.
  • label is must_fix, question or nit.
  • suggestion is for new-side lines only.

Machines

Added in 2.4

ToolWhat it doesParametersCommandOwn item
add_workerRegisters a machine that may run steps. Human. Without ssh, the reply carries a one-time token and the command to run on the machine.name (required), ssh, capacity (unset: the machine's own limit, else 1), repos, give_up_after, groups, enabled (false: takes no new steps).kraft admin worker addAPI only: any item
edit_workerChanges a machine, or local (only enabled, capacity and groups). Human. Only what you pass changes; the reply is its row.name (required), enabled, capacity, unset_capacity, give_up_after, groups ([] clears), repos, every_repo, ssh. capacity and unset_capacity go not together, nor repos and every_repo.kraft admin worker edit, enable, disableAPI only: any item
rotate_worker_tokenA new token for a dial-in machine, returned once with the command to run. The old one stops working at once. Human.name (required).kraft admin worker rotate-tokenAPI only: any item
list_workersLists the machines: online or offline and why, whether each takes new steps, slots, repos, last seen, Kraft version, the items whose steps it holds, and why it can't be removed.nonekraft admin worker listAPI only: any item
remove_workerRemoves a machine and revokes its token or ssh entry. Refused while a step runs on it, and for local. Human.name (required).kraft admin worker removeAPI only: any item

For Kraft's own workers

ToolWhat it doesParametersCommandOwn item
report_progressReports that the worker started a plan task.task (required): the N of the plan's ## Task N heading. work_item_id.kraft item progress
reply_to_threadAnswers a review thread.thread_id, body (both required), claim (fixed, answered or should_fix).kraft item reply
set_mr_labelsLabels the merge request and re-creates its pipeline.labels (required), work_item_id.kraft item mr-label
rerun_failed_ciRe-runs the failed CI jobs of the merge request, from a fix-loop repair that found they died outside the code. Once per fix attempt. Added in 2.6reason (required), work_item_id.kraft item rerun-ci
permission_requestNot for an agent to call: Kraft passes it to Claude Code as --permission-prompt-tool. See Permission gate.tool_name, input (both required), tool_use_id.none
  • CLI: the verb behind each tool, with its flags and output.
  • Use Kraft from your agent: how to register these tools with an agent, and how to check that it works.
  • Permission gate: how Kraft answers a worker's asks, and what permission_request is for.
Copyright © 2026