Skip to main content
Glama

Get disk space information

get_disk_usage
Read-only

Check disk space usage in WSL environments to monitor storage capacity and identify potential space constraints.

Instructions

Get disk space information

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathNoPath to check

Implementation Reference

  • Handler function that executes the 'df -h' command to get disk usage, optionally for a specific path, formats the output, and handles errors.
    async ({ path }) => {
    	try {
    		const cmd = path ? `df -h "${path}"` : 'df -h';
    		const result = await this.command_executor.execute_command(cmd);
    		return {
    			content: [
    				{
    					type: 'text' as const,
    					text: this.format_output(result),
    				},
    			],
    		};
    	} catch (error) {
    		return {
    			content: [
    				{
    					type: 'text' as const,
    					text: `Error: ${error instanceof Error ? error.message : String(error)}`,
    				},
    			],
    			isError: true,
    		};
    	}
    },
  • Input schema for the get_disk_usage tool, defining an optional 'path' parameter.
    schema: v.object({
    	path: v.optional(
    		v.pipe(
    			v.string(),
    			v.description('Path to check'),
    		),
    	),
    }),
  • src/index.ts:232-272 (registration)
    Registration of the 'get_disk_usage' tool using this.server.tool, including name, description, schema, annotations, and inline handler.
    this.server.tool(
    	{
    		name: 'get_disk_usage',
    		description: 'Get disk space information',
    		schema: v.object({
    			path: v.optional(
    				v.pipe(
    					v.string(),
    					v.description('Path to check'),
    				),
    			),
    		}),
    		annotations: {
    			readOnlyHint: true,
    		},
    	},
    	async ({ path }) => {
    		try {
    			const cmd = path ? `df -h "${path}"` : 'df -h';
    			const result = await this.command_executor.execute_command(cmd);
    			return {
    				content: [
    					{
    						type: 'text' as const,
    						text: this.format_output(result),
    					},
    				],
    			};
    		} catch (error) {
    			return {
    				content: [
    					{
    						type: 'text' as const,
    						text: `Error: ${error instanceof Error ? error.message : String(error)}`,
    					},
    				],
    				isError: true,
    			};
    		}
    	},
    );
Behavior3/5

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

The annotations already declare readOnlyHint=true, so the agent knows this is a safe read operation. The description doesn't contradict this (it uses 'get' which aligns with read-only). However, the description adds no behavioral context beyond what annotations provide—it doesn't mention what specific disk metrics are returned, whether it requires special permissions, if there are rate limits, or how it handles errors. With annotations covering safety, a baseline 3 is appropriate as the description adds minimal value.

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 extremely concise—a single phrase with zero wasted words. It's front-loaded with the core purpose, though this brevity comes at the cost of detail. Every word earns its place, making it efficient for quick scanning.

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 the tool's simplicity (1 optional parameter, read-only annotation, no output schema), the description is incomplete. It doesn't explain what disk information is returned (e.g., free space, total space, usage percentage), how to interpret results, or default behavior if 'path' is omitted. With no output schema, the description should compensate by outlining return values, but it fails to do so.

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?

The input schema has 1 parameter with 100% description coverage ('Path to check'), so the schema fully documents the parameter. The description adds no meaning beyond what the schema provides—it doesn't explain what 'path' means in context (e.g., filesystem path, default behavior if omitted), nor does it provide examples or constraints. Baseline 3 is correct when schema coverage is high.

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

Purpose2/5

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

Tautological: description restates name/title.

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

Usage Guidelines1/5

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

The description provides no guidance on when to use this tool versus alternatives. There are no explicit when/when-not instructions, no mention of prerequisites, and no reference to sibling tools like 'get_directory_info' or 'get_system_info' that might offer overlapping functionality. The agent receives no usage context beyond the tool name.

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/spences10/mcp-wsl-exec'

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