Skip to main content
Glama

OpenFactory

prepare_harness_build

Create a build + prepared worktree WITHOUT queueing the autonomous pipeline.

Create-without-queue primitive for the interactive build terminal: the calling agent is the single driver and orchestrates the build itself, so this must be used instead of create_build (which would queue a second, autonomous pipeline over the same recipe). Pass platform_agent=True to buy out of that and have OpenFactory's own goal agent drive instead; it is the only way to get one here, and it needs a plan that includes it. When a conversation is bound, cancels that conversation's previous active interactive build first. It never cancels another unbound caller's build. It creates and persists the record, canonicalizes the recipe, prepares the primed worktree (deterministic distro and package inputs), and marks the build "building". No email notifications fire on this path — the user is present in the terminal.

The returned agent_mode (author | report-only) governs authoring: report-only is the worker-owned pipelines only (pi-gen, pmbootstrap), whose configure() writes the config later, during build_image dispatch, so their agent authors nothing (agent_mode_notice restates the rule). Every other worker returns author, because the preparation path is actuators only and the agent is the sole author of config/.

Returns: {build_id, worktree_path, branch_name, agent_mode, session_token}

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": {
      "recipe": "<recipe>"
    },
    "name": "prepare_harness_build"
  }
}

Input Schema

NameRequiredDescriptionDefault
promptNoThe owner's original natural-language request, if there was one. Persisted privately as durable planning intent and seeded as the opening user message; provide the owner's words, not a narrowed recipe summary.
recipeYesThe build recipe as a JSON object (or a JSON string). Required: name, base_image. Put OS features, packages, services, users, networking, and security under os.
api_keyNoOpenFactory MCP API key (optional).
create_chatNoCreate a chat for this build, seeded with the prompt and a recipe card, and link it so the build is reachable from the sidebar and opens the build panel. Leave on unless you're generating bulk/QA builds.
build_contextNoStructured Chat/TTY build selections to apply to the recipe.
session_tokenNoSession token from a previous tool response. IMPORTANT: Always pass the session_token from the most recent tool response to maintain session continuity.
platform_agentNoHand this build to OpenFactory's own goal agent instead of driving it yourself. A paid add-on: included with the Builder, Team, Compliance and BYOC Fleet plans, and refused with error_code=upgrade_required on a plan without it. Omit it and YOU drive -- you get the worktree and no platform agent is started, which is the normal way to use this tool and costs no upgrade.
owning_conversation_idNoExisting owner-scoped conversation to bind before goal/worktree preparation. Used by the unified v3 harness.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.7/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations supplied, the description carries the full burden and does so: it discloses the conversation-bound cancellation of a prior active build, the invariant that it never cancels another unbound caller's build, the side effects (persist record, canonicalize recipe, prime worktree with deterministic distro/package inputs, mark 'building'), and that no email notifications fire. It also explains the agent_mode author vs report-only rule and why pi-gen/pmbootstrap workers return report-only.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the core distinction before the mechanics, and the Returns line is useful. It is dense and somewhat sprawling, with backtick-heavy prose and platform_agent guidance duplicated between the description and the schema, which costs a point.

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?

An output schema exists, so enumerating returns is a bonus rather than a necessity, and the mutation/cancellation behavior is well covered for an unannotated tool. Minor gaps remain: the failure surface is only illustrated by upgrade_required, and the description doesn't say what the caller is expected to do next (e.g. dispatch build_image) after preparation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so baseline is 3, but the description adds meaning beyond the schema for owning_conversation_id (binding triggers cancellation of that conversation's previous active build) and reinforces the platform_agent trade-off and plan gating. It largely restates platform_agent rather than adding new syntax, so it stops short of a 5.

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

Purpose5/5

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

Opens with a specific verb+resource plus an explicit negation of scope ('Create a build + prepared worktree WITHOUT queueing the autonomous pipeline'), and names the sibling create_build as the thing it is not. An agent can distinguish it from create_build and create_build_from_prompt without opening any schema.

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

Usage Guidelines5/5

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

Gives an explicit routing rule: use this instead of create_build for the interactive terminal because create_build would queue a second autonomous pipeline over the same recipe. It also states the condition that flips behavior (platform_agent=True, paid add-on, requires a plan that includes it) and the default expectation that the caller drives.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.