nextv2.0.0
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, 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.

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 cannot 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.

Three exceptions:

  • An escalation turn is not 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 has not started. 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.
  • The API refuses add_review_comment, submit_review, resolve_thread and reopen_thread 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.status: paused, active, queued, blocked, waiting, rate_limited, needs_human, completed or abandoned.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
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, skip_nodes, budget_usd, node_overrides, and chain_template (the pre-2.0 name of chain, still read; chain wins when both are given).kraft item create
ensure_repoConnects the repo if it is not connected yet. See Connecting a repo.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.
  • 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 cannot be added later.
  • budget_usd sets a dollar cap. This tool can set a cap but not lift one.

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.

With test_command: "" the repo is saved disabled: a repo with no tests passes every work item's verification untested, so a person enables it, not the agent. An already-connected repo is left as it is.

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).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.work_item_id, dependency.kraft item unblockrefused
resume_work_itemStarts a paused item, including one just filed. 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 only way back onto a stopped item. It does not 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.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. Raise a cap that stopped an item 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 (required), work_item_id.kraft 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.work_item_id, model, escalate_model, effort, clear (default false).kraft item set-overridesrefused
set_node_overridesSets one node's agent overrides.node_id (required), work_item_id, auto_escalate, auto_escalate_stuck, auto_escalate_delay_s, model, effort, extra_prompt, clear (default false).kraft 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.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.

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
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