fast_get_disk_usage
Retrieve disk usage statistics for specified directories on the fast-filesystem-mcp server. Optimized for reliability and multi-block operations.
Instructions
디스크 사용량을 조회합니다
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | No | 조회할 경로 | / |
Implementation Reference
- api/server.ts:830-859 (handler)The handler function that implements the 'fast_get_disk_usage' tool. It uses the 'df -h' shell command to retrieve disk usage information for the specified path, parsing the output to return formatted results including filesystem, total/used/available space, usage percentage, and mount point.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() }; }
- api/server.ts:207-216 (schema)The tool definition including name, description, and input schema. The schema specifies an optional 'path' parameter (string, defaults to '/'). This is part of the MCP_TOOLS array used for tool listing.{ name: 'fast_get_disk_usage', description: '디스크 사용량을 조회합니다', inputSchema: { type: 'object', properties: { path: { type: 'string', description: '조회할 경로', default: '/' } } } },
- api/server.ts:344-346 (registration)Registration in the tools/call handler switch statement, which dispatches tool calls to the corresponding handler function.case 'fast_get_disk_usage': result = await handleGetDiskUsage(args); break;