Skip to main content
Glama

buildx_bake

Build multiple Docker targets defined in a bake file (HCL, JSON, or compose) for multi-target builds, with controls for push, load, caching, and per-target overrides.

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 — 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
Behavior5/5

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

Annotations only provide readOnlyHint/destructiveHint, both false. The description adds valuable behavioral context: it does not raise on non-zero CLI exit, cwd behavior when no local plugin, and the default timeout. These go beyond the annotations and are important for agent execution.

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 front-loaded with purpose and usage, then includes a concise behavior warning, followed by a clean parameter list. Every sentence serves a purpose, and the structure is easy to scan despite the large number of parameters.

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?

Despite having no output schema, the description includes the return type (dict with returncode/stdout/stderr/truncated). It covers file types, target selection, overrides, and builder context. It is complete for a build tool with 10 optional parameters and no required inputs.

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?

Schema description coverage is 0%, so the description carries full responsibility. It manually explains all 10 parameters with defaults, examples (e.g., set_overrides), and file flag semantics. This fully compensates for the schema gap.

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 clearly states 'Build multiple targets defined in a bake file (HCL, JSON, or compose)' and explicitly distinguishes from buildx_build for single Dockerfile targets. This provides a specific verb, resource, and scope, making it easy to identify.

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 ('multi-target builds declared in docker-bake.hcl/compose files') and when not to ('for a single Dockerfile target use buildx_build'), naming the alternative. It also adds usage nuance by noting non-zero CLI exits are not raised and telling the agent to inspect returncode/stderr.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/L337-org/docker-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server