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
| Name | Required | Description | Default |
|---|---|---|---|
| path | No | Path 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: '/' } } } },
- api/server.ts:210-215 (schema)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;
- api/server.ts:830-859 (handler)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() }; }