Skip to main content
Glama

buildx_bake

Build multiple container targets from a bake file (HCL, JSON, or compose). Use for multi-target Docker builds when a single Dockerfile target is insufficient.

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?

Beyond annotations (readOnlyHint: false, destructiveHint: false), the description discloses non-raising behavior and the subprocess nature via returncode. The cwd parameter description adds context about file copying when no local plugin. This adds significant context beyond the annotations.

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 concise and front-loaded with the purpose, followed by a structured args list. Each sentence earns its place, and the parameter details are organized clearly without unnecessary verbosity.

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?

The description includes the return dict format ('returncode', 'stdout', 'stderr', 'truncated'), covers all parameters, and provides usage guidance. With no output schema, this is complete for a multi-parameter build tool with potential side effects (push, load).

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 schema description coverage at 0%, the description fully compensates by listing all 10 parameters with meaningful explanations, including an example for set_overrides ('app.platform=linux/amd64'), CLI flags for files ('-f'), and default values for cwd and timeout_seconds. This adds substantial meaning beyond the 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?

States the verb 'Build' with a specific resource: 'multiple targets defined in a bake file (HCL, JSON, or compose)' and differentiates from sibling buildx_build by mentioning 'for a single Dockerfile target use buildx_build'. This is a specific verb+resource+scope.

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?

Explicitly states when to use ('Use it for multi-target builds declared in docker-bake.hcl/compose files') and provides an alternative ('for a single Dockerfile target use buildx_build'). Also notes a key behavior: 'Does not raise on a non-zero CLI exit — inspect returncode/stderr in the result.'

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