Skip to main content
Glama

fast_get_disk_usage

Check disk usage information for any specified path to monitor storage consumption and manage filesystem capacity.

Instructions

Gets disk usage information

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathNoPath to check/

Implementation Reference

  • api/server.ts:207-216 (registration)
    Tool registration in MCP_TOOLS array including name, description, and input schema.
    {
      name: 'fast_get_disk_usage',
      description: '디스크 사용량을 조회합니다',
      inputSchema: {
        type: 'object',
        properties: {
          path: { type: 'string', description: '조회할 경로', default: '/' }
        }
      }
    },
  • Input schema defining the 'path' parameter for disk usage query.
    inputSchema: {
      type: 'object',
      properties: {
        path: { type: 'string', description: '조회할 경로', default: '/' }
      }
    }
  • api/server.ts:344-346 (registration)
    Switch case in tools/call handler that registers and invokes the tool handler.
    case 'fast_get_disk_usage':
      result = await handleGetDiskUsage(args);
      break;
  • Main handler function that executes 'df -h' command to retrieve disk usage information for the specified path and parses the output into structured data.
    async function handleGetDiskUsage(args: any) {
      const { path: targetPath = '/' } = args;
      
      try {
        const { stdout } = await execAsync(`df -h "${targetPath}"`);
        const lines = stdout.split('\n').filter(line => line.trim());
        
        if (lines.length > 1) {
          const data = lines[1].split(/\s+/);
          return {
            filesystem: data[0],
            total: data[1],
            used: data[2],
            available: data[3],
            use_percentage: data[4],
            mounted_on: data[5],
            path: targetPath,
            timestamp: new Date().toISOString()
          };
        }
      } catch {
        // Fallback for systems without df command
      }
      
      return {
        error: 'Unable to get disk usage information',
        path: targetPath,
        timestamp: new Date().toISOString()
      };
    }

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/efforthye/fast-filesystem-mcp'

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