Skip to main content
Glama

buildx_bake

Build multiple Docker targets defined in bake or compose files, using HCL or JSON configs, with options for push, load, and caching. Run all targets in one command and receive detailed output for automated workflows.

Instructions

Build multiple targets defined in a bake file (HCL, JSON, or compose).

Use it for multi-target builds declared in docker-bake.hcl/compose files; for a single Dockerfile target use buildx_build. Does not raise on a non-zero CLI exit (a missing buildx plugin or a timeout still raises) - inspect returncode/stderr in the result.

Args: targets: Bake targets to build (default: the default group) files: Bake file paths (-f, repeatable) set_overrides: Per-target overrides, e.g. ["app.platform=linux/amd64"] push: Push results to the registry load: Load results into the local image store no_cache: Do not use cache when building pull: Always pull a newer base image builder: Override the active builder cwd: Working directory containing the bake file (defaults to the server's cwd; copied to the target host if no local plugin) timeout_seconds: Subprocess timeout (default 1800s)

Returns: dict: {"returncode": int, "stdout": str, "stderr": str, "truncated": bool}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cwdNo
loadNo
pullNo
pushNo
filesNo
builderNo
targetsNo
no_cacheNo
set_overridesNo
timeout_secondsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv2.1.4
  2. Removedv2.1.4
  3. First observedv1.9.0

TDQS

A5/5.0
Behavior5/5

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

Over and above the annotations, it discloses a key behavioral twist: non-zero CLI exits do NOT raise, while a missing plugin or timeout DOES raise, and the agent should inspect `returncode`/`stderr`. It also adds the real-world nuance that `cwd` is copied to the target host when no local plugin is present. These are non-obvious behaviors that materially affect how an agent interprets results.

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

Conciseness5/5

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

The description is tightly organized: purpose, usage decision, exception/return behavior, parameter list, and return structure. Each line earns its place; there is no filler or repetition of what the schema already shows without added value.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 10-parameter tool with no output schema, this description is thorough: it documents the args array, the return dict shape, default values, and atypical exit behavior. It gives an agent everything needed to invoke it correctly and interpret results confidently.

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

Parameters5/5

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

With 0% schema description coverage, the description carries the full burden for all 10 parameters. It covers each parameter with meaningful prose: `targets` default, `files` manual repeatability, `set_overrides` with an inline example, `cwd` copy behavior, and `timeout_seconds` default. This is excellent compensation for the sparse schema.

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?

The description opens with a specific verb and resource: 'Build multiple targets defined in a bake file (HCL, JSON, or compose).' It also explicitly differentiates from the single-target sibling (`buildx_build`), so an agent can immediately tell which tool is for which job.

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?

It explicitly states when to use the tool ('Use it for multi-target builds declared in docker-bake.hcl/compose files') and when not to, directing single Dockerfile targets to `buildx_build`. This is clear, actionable, and leaves little room for misinterpretation.

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

Deploy Server

Other Tools