Skip to main content
Glama
JackXuyi

Current operating environment

getDiskUsage

Check current disk space usage on your system to monitor storage capacity and prevent data loss from insufficient space.

Instructions

获取当前平台的硬盘使用率

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The core handler implementation for the 'getDiskUsage' tool. It checks the platform (macOS vs others) and executes the appropriate 'df' command via execSync to retrieve disk usage information, then returns it as text content in the MCP response format.
    case "getDiskUsage": {
      let diskUsage;
      if (os.platform() === 'darwin') {
        // macOS 使用 df -h 命令
        diskUsage = execSync('df -h').toString();
      } else {
        // 其他平台使用 df -h --output=used,size,pcent 命令
        diskUsage = execSync('df -h --output=used,size,pcent').toString();
      }
    
      return {
        content: [{
          type: "text",
          text: diskUsage
        }]
      };
    }
  • The tool schema definition for 'getDiskUsage', registered in the listTools response. Includes the tool name, description in Chinese ('Get current platform's disk usage rate'), and an empty input schema (no parameters required).
    {
      name: "getDiskUsage",
      description: "获取当前平台的硬盘使用率",
      inputSchema: {
        type: "object",
        properties: {},
        required: []
      }
    },
  • src/index.ts:787-787 (registration)
    Registration of the listTools handler function, which returns the list of tools including 'getDiskUsage' schema.
    server.setRequestHandler(ListToolsRequestSchema, handleRequest);
  • src/index.ts:790-790 (registration)
    Registration of the callTool handler function, which contains the switch case dispatching to the 'getDiskUsage' implementation.
    server.setRequestHandler(CallToolRequestSchema, handleCallToolRequest);
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states it gets disk usage but doesn't specify what data is returned (e.g., percentage, free space, total space), whether it's real-time or cached, any permissions required, or potential errors. For a tool with zero annotation coverage, this leaves significant gaps in understanding its behavior.

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 in Chinese that directly states the tool's purpose without any unnecessary words. It is front-loaded and appropriately sized for a simple, parameter-less tool, 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 the lack of annotations and output schema, the description is incomplete for effective use. It doesn't explain the return format (e.g., numeric value, structured data), units, or any behavioral nuances. For a tool that likely returns system metrics, more context is needed to understand what the agent will receive and how to interpret it.

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?

The tool has 0 parameters, and schema description coverage is 100%, so there are no parameters to document. The description doesn't need to add parameter semantics beyond what the schema provides. A baseline score of 4 is appropriate as it avoids redundancy while clearly indicating no inputs are required.

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 action ('获取' meaning 'get') and resource ('硬盘使用率' meaning 'hard disk usage'), making the purpose immediately understandable. It distinguishes itself from siblings by focusing specifically on disk usage rather than other system metrics like CPU, memory, or network. However, it doesn't specify the platform scope beyond '当前平台' (current platform), which is somewhat vague.

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention any prerequisites, context for usage, or comparisons to sibling tools like getHardwareInfo or getPlatformInfo that might overlap. The agent must infer usage based solely on the tool name and description without explicit direction.

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/JackXuyi/env-mcp'

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