Skip to main content
Glama

buildx_du

Read-only

Reports BuildKit cache disk usage to identify large caches in need of pruning. Accepts an optional builder override.

Instructions

Report BuildKit cache disk usage as a list of records.

A large cache can easily generate more output than MAX_CLI_OUTPUT_BYTES; if that happens the captured stdout is truncated and this tool drops the final (partial) record before parsing. For an exhaustive accounting on a busy builder, run docker buildx du --format '{{json .}}' on the host directly. Reclaim the cache with buildx_prune (system_df covers daemon-side disk, not builder cache). Raises RemoteFailureError if the CLI call fails.

Args: builder: Override the active builder

Returns: list: One dict per cache record (parsed from --format '{{json .}}')

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
builderNo

Schema Changelog

Changes observed during successful MCP inspections.

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

TDQS

A4.9/5.0
Behavior5/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false, but the description adds significant behavioral context: it can drop the final partial record when output exceeds MAX_CLI_OUTPUT_BYTES, and it raises RemoteFailureError on CLI failure. These are not implied by annotations and help an agent anticipate failure modes.

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?

Front-loaded with the core purpose, followed by necessary caveats (truncation), remediation (run on host), and cross-references. Each sentence earns its place, with no redundancy. The Args/Returns block is compact and structured.

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 specifies the return as a list of dicts parsed from the JSON format. It covers the truncation edge case, error behavior, and the parameter semantics. For a simple read-only reporting tool, this is complete: an agent knows what to expect, when to use alternatives, and how to handle failures.

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 description coverage is 0%, so the description carries full responsibility for the 'builder' parameter. It explains it 'Overrides the active builder', which gives clear meaning beyond the raw name and type. It does not mention the default behavior explicitly, but 'override' implies it uses the active builder if not provided. This is adequate for a single optional parameter.

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 a specific verb 'Report' and a precise resource 'BuildKit cache disk usage as a list of records', and distinguishes itself from related tools by noting system_df covers daemon-side disk and buildx_prune reclaims cache. Clear and unambiguous.

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 names alternatives and when to use them: 'Reclaim the cache with buildx_prune (system_df covers daemon-side disk, not builder cache)' and advises running the CLI on host directly for exhaustive accounting if output is large. Provides clear when-to-use and when-not-to-use context.

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