build_image
Prepare, build, verify, and publish one OS image lifecycle.
This is the ONLY way the harness can produce an ISO — it has no root and must
not run build.sh directly. The worktree path and base image come from the
build record (never trusted from the caller), but it builds the config/ you
authored: from the recipe it writes only config/distribution, the
os.packages/os.services package list (Debian targets), the archive entries
for published os.custom_obs_packages and the installer manifest. Feature
packages and hooks, ENABLE_* gates, branding, users, the desktop session,
GRUB/Plymouth and wallpaper exist only if you wrote them, so a recipe alone
builds a stock image. Run check_image_inputs before every call.
Streams build output to the dashboard and returns the durable
lifecycle result. wait_seconds may keep an existing detached build in
this call for up to 300 seconds; otherwise re-call the same tool while
fleet build or finalization is in progress. Durable polling never
redispatches or takes ownership from the worker/finalizer.
It accepts edits from config/recipe.json before choosing a cached result.
A fleet-dispatched image's result is returned once: re-calling reads a
build still running, still finalizing, or finished but not yet answered,
and never redispatches it; after a call has returned its finished answer
(finalized, a terminal failure, or a v2 session handover), the next call
builds a fresh image only when the canonical inputs have changed. If the
finalized image has the same recorded inputs, the tool preserves it and
directs you to verification instead of consuming another attempt.
Read a returned result or
verdict with get_build_status or get_verification_session. Before building it checkpoints config, stages package archives and uploads,
refuses a second concurrent call for the same build
(in_progress: True), cleans stale live-build state/mounts left by a
prior attempt (deliberately NO git reset — an agent's between-retry fixes
are working-tree edits and must survive), and dispatches the authored config.
A successful image is finalized and tested in this same call. success
therefore means the full lifecycle is certified; image_built separates
a verification failure from an image compilation failure.
Only for builds your own MCP client drives: a free client-driven account gets five new image dispatches per UTC month, including failed compiles. A platform goal build has no per-build attempt cap. Polling, replay and verification-only checks consume none. This is separate from the one verified hosted-chat result. A quota refusal includes the paid-signup URL to relay to the owner.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"build_id": "<build_id>"
},
"name": "build_image"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| api_key | No | OpenFactory MCP API key (optional). | |
| build_id | Yes | The build to prepare, compile, verify, and publish. | |
| wait_seconds | No | ||
| session_token | No | Session token from a previous tool response. IMPORTANT: Always pass the session_token from the most recent tool response to maintain session continuity. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||