Skip to main content
Glama

system_disk_usage

Monitor system disk usage to identify storage consumption and manage capacity across filesystems or specific paths.

Instructions

Show disk usage for the system or a specific path

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathNoSpecific path to check (optional, shows all filesystems if omitted)

Implementation Reference

  • The implementation of the `diskUsage` function that executes `du` or `df` commands to check disk usage.
    export async function diskUsage(args: Record<string, unknown>): Promise<string> {
      const path = args.path as string | undefined;
    
      try {
        if (path) {
          const { stdout } = await execFileAsync("du", ["-sh", path], { timeout: 30000 });
          return `Disk usage for '${path}':\n${stdout.trim()}`;
        }
    
        const { stdout } = await execFileAsync("df", ["-h"], { timeout: 10000 });
        return `Disk usage:\n\n${stdout.trim()}`;
      } catch (error: any) {
        throw new Error(`Failed to get disk usage: ${error.message}`);
      }
    }
  • The registration of the `system_disk_usage` tool in the MCP tool list.
    {
      name: "system_disk_usage",
      description: "Show disk usage for the system or a specific path",
      inputSchema: {
        type: "object" as const,
        properties: {
          path: { type: "string", description: "Specific path to check (optional, shows all filesystems if omitted)" },
        },
      },
    },
  • The switch case in `handleSystemTool` that delegates to `diskUsage`.
    case "system_disk_usage": return diskUsage(a);
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states it 'shows' disk usage, implying a read-only operation, but doesn't disclose behavioral traits like output format (e.g., human-readable vs. structured data), permissions needed, performance impact, or error handling. For a tool with zero annotation coverage, this is inadequate.

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 a single, efficient sentence that front-loads the core purpose ('Show disk usage') and clarifies scope ('for the system or a specific path'). There is zero wasted text, making it easy to parse quickly.

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

Completeness2/5

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

Given no annotations and no output schema, the description is incomplete. It lacks details on what disk usage metrics are shown (e.g., total, used, free space), output format, or error conditions. For a system monitoring tool with potential complexity, this leaves significant gaps for an AI agent to use it effectively.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, with the parameter 'path' fully documented in the schema. The description adds minimal value by mentioning 'specific path to check' and default behavior when omitted, but doesn't provide additional semantics like path format examples or filesystem constraints. Baseline 3 is appropriate given high schema coverage.

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 clearly states the verb 'show' and resource 'disk usage', specifying it can be for 'the system or a specific path'. It distinguishes from siblings like system_logs or system_network_connections by focusing on disk metrics. However, it doesn't explicitly differentiate from potential disk-related tools not present in the sibling list.

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 guidance on when to use this tool versus alternatives is provided. The description mentions optional path parameter usage but doesn't explain scenarios for system-wide vs. path-specific checks or relate to other monitoring tools like system_processes. Usage context is implied but not explicit.

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/batu-sonmez/infraclaude'

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