Skip to main content
Glama

disks/usage

Read-onlyIdempotent

Measure disk space used by a directory tree, with options for depth, exclusions, apparent sizes, and JSON output; read-only and can run privileged for unreadable paths.

Instructions

Measures how much disk space a directory tree uses (native walk, like du). Read-only. For the free space of a whole filesystem use disks/free; to find individual big files use files/find with size. By default the reply is one grand total; max_depth: N also lists directories up to N levels deep, largest first; all: true adds a per-file list (text output only). Sizes are allocated blocks unless apparent_size: true; hard links count once, symlinks are never followed. exclude patterns containing / match the full path (/proc, /var/lib/*), others the base name. Unreadable directories are skipped silently, so an unprivileged total can under-count: use privileged: true (a grant with a paths: entry). Results are cached for 60 s per user and arguments. The shipped config allows 300 s, otherwise the default is 30 s. Text ends with Total size of PATH: N; output_format: json returns an object (path, total_size, human_size with human_readable, directory_sizes as a path-to-bytes map only when max_depth > 0).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
allNoAlso list every file, largest first (text output only)
pathYesAbsolute path of the directory to measure
excludeNoPatterns to skip: one containing '/' matches the full path (e.g. '/proc', '/var/lib/*'), others the base name (e.g. '*.tmp')
max_depthNo0 or omitted: grand total only; N: also list directories up to N levels deep, largest first
thresholdNoBytes: a positive value hides entries smaller than this, a negative value hides larger ones (printed lines only)
privilegedNoRun as root. Needs a grant for this tool in mcp-sudo.yaml and a `paths:` entry covering the path, otherwise refused
apparent_sizeNoReport logical file sizes instead of allocated disk blocks
output_formatNoUse json for structured output (yaml, table and wide return the same JSON); default is text
separate_dirsNoFor directories do not include size of subdirectories (-S)
human_readableNoSizes like du -h (4.0 KiB); default is bytes
one_file_systemNoSkip directories on different file systems (-x)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed8 schema fields changedv0.4.1
    • changedInput schema / properties / all / description
      Previous value: -"Write counts for all files, not just directories (-a)"New value: +"Also list every file, largest first (text output only)"
    • changedInput schema / properties / apparent_size / description
      Previous value: -"Print apparent sizes rather than device usage (--apparent-size)"New value: +"Report logical file sizes instead of allocated disk blocks"
    • changedInput schema / properties / exclude / description
      Previous value: -"Patterns to exclude"New value: +"Patterns to skip: one containing '/' matches the full path (e.g. '/proc', '/var/lib/*'), others the base name (e.g. '*.tmp')"
    • changedInput schema / properties / max_depth / description
      Previous value: -"How deep to recurse (0 for summarize only)"New value: +"0 or omitted: grand total only; N: also list directories up to N levels deep, largest first"
    • changedInput schema / properties / output_format / description
      Previous value: -"Desired output format (e.g. json, yaml, table, wide). Defaults to text"New value: +"Use json for structured output (yaml, table and wide return the same JSON); default is text"
    • changedInput schema / properties / path / description
      Previous value: -"Target directory to measure"New value: +"Absolute path of the directory to measure"
    • changedInput schema / properties / privileged / description
      Previous value: -"Set to true to run as root"New value: +"Run as root. Needs a grant for this tool in mcp-sudo.yaml and a `paths:` entry covering the path, otherwise refused"
    • changedInput schema / properties / threshold / description
      Previous value: -"Exclude entries smaller than SIZE if positive, or greater than SIZE if negative (-t)"New value: +"Bytes: a positive value hides entries smaller than this, a negative value hides larger ones (printed lines only)"
  2. First observed

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already declare readOnly/idempotent/non-destructive, and the description adds substantial context beyond them: 60 s per-user result caching, the 300 s shipped vs 30 s default timeout, silent skipping of unreadable directories (and the resulting possible under-count), hard-link/symlink handling, and the `privileged` grant requirement via mcp-sudo.yaml. The one meaningful gap is that it doesn't say whether `exclude` or `threshold` interact with the cached result set, but overall this is unusually rich behavioral disclosure.

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?

The purpose and sibling routing are front-loaded, followed by dense but relevant behavioral and parameter detail. Every sentence carries information, though the single long paragraph is heavy and could be broken up for scannability.

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 an 11-parameter tool with no output schema, the description compensates well: it explains default vs max_depth vs all output modes, the text trailer ('Total size of PATH: N'), and the JSON object shape including directory_sizes only when max_depth > 0. Nothing an agent needs to call or interpret the result is missing.

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 the baseline is 3; the description goes further by tying parameters to output behavior ('By default the reply is one grand total; max_depth: N also lists directories...; all: true adds a per-file list (text output only)') and clarifying that allocated blocks are the default unit unless apparent_size. It leaves `threshold`, `separate_dirs`, and `one_file_system` entirely to the schema, so it isn't a full complement.

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 and resource ('Measures how much disk space a directory tree uses') and explicitly frames it against siblings, calling out `disks/free` for filesystem free space and `files/find` for individual big files. An agent can distinguish this from the other disks/* tools 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?

Explicitly names the two alternatives (whole-filesystem free space -> `disks/free`; individual big files -> `files/find` with `size`) and the conditions that select them. This is textbook when-to-use/when-not guidance.

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