Skip to main content
Glama

get_directory_size

Recursively calculate a directory's total size and file count to monitor disk usage. Returns bytes, megabytes, and number of files for a workspace-relative path.

Instructions

Recursively calculate the total size of a directory's contents.

Args: path: Directory to measure, relative to the workspace root.

Returns: Total size in bytes and megabytes, plus the number of files counted.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathNo.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.5/5.0
Behavior3/5

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

With no annotations, the description carries the full burden. It discloses recursion and the return format (bytes, MB, file count), but omits performance implications on large directories, symlink handling, permission errors, and whether the operation is strictly read-only.

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 uses a titled purpose plus 'Args' and 'Returns' sections with no filler. It is front-loaded and easy to scan.

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

Completeness4/5

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

For a simple read-only directory-size tool with one parameter and no output schema, the description covers purpose, parameter semantics, and return values. It lacks edge-case behavior and performance notes, but is otherwise complete enough to invoke correctly.

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 0%, so the description must document the parameter. It does: 'path: Directory to measure, relative to the workspace root' clarifies the parameter's type, meaning, and base directory, adding significant value beyond the bare schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb ('calculate') and resource ('total size of a directory's contents') with scope ('recursively'), clearly distinguishing it from siblings like get_file_info or get_disk_info. However, it does not explicitly name an alternative tool to differentiate, so it falls short of a 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No when-to-use or when-not-to-use guidance is provided; the description only explains what the tool does. The agent must infer that this is for measuring directory sizes versus other file or directory tools.

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