Skip to main content
Glama
batteryshark

System Information MCP Server

by batteryshark

get_storage_analysis

Analyze disk storage across all partitions to monitor capacity and usage for effective space management and troubleshooting.

Instructions

Get disk and storage analysis - all partitions, capacity, usage.

Comprehensive storage overview including all mounted volumes and usage stats. Critical for disk space management and storage troubleshooting.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler function for the 'get_storage_analysis' tool, decorated with @mcp.tool which registers it with the FastMCP server. It adds a header with timestamp, calls the helper get_storage_info() to collect storage data, handles exceptions, and formats the output as a ToolResult using text_response.
    @mcp.tool
    def get_storage_analysis() -> ToolResult:
        """Get disk and storage analysis - all partitions, capacity, usage.
        
        Comprehensive storage overview including all mounted volumes and usage stats.
        Critical for disk space management and storage troubleshooting.
        """
        info_sections = []
        info_sections.append("# Storage Analysis")
        info_sections.append(f"*Generated: {datetime.now().strftime('%Y-%m-%d %H:%M:%S')}*\n")
        
        try:
            info_sections.extend(get_storage_info())
        except Exception as e:
            info_sections.append(f"⚠️ **Storage detection error**: {str(e)}")
        
        return text_response("\n".join(info_sections))
  • Supporting utility function that implements the core storage analysis logic using psutil.disk_partitions() and disk_usage(). Iterates over all disk partitions, calculates capacity and usage statistics, determines disk types, skips temporary filesystems and inaccessible drives, and returns formatted list of storage information.
    def get_storage_info() -> List[str]:
        """Get disk and storage information"""
        info = []
        info.append("\n## 💾 Storage")
        
        disk_partitions = psutil.disk_partitions()
        for partition in disk_partitions:
            try:
                disk_usage = psutil.disk_usage(partition.mountpoint)
                total_gb = disk_usage.total / (1024**3)
                free_gb = disk_usage.free / (1024**3)
                used_percent = (disk_usage.used / disk_usage.total) * 100
                
                # Determine disk type
                disk_type = "Fixed"
                if partition.opts and 'removable' in partition.opts:
                    disk_type = "Removable"
                elif partition.fstype in ['tmpfs', 'devtmpfs']:
                    continue  # Skip temporary filesystems
                    
                info.append(f"\n### {partition.device} ({partition.mountpoint})")
                info.append(f"- **Type**: {disk_type} ({partition.fstype})")
                info.append(f"- **Total**: {total_gb:.1f} GB")
                info.append(f"- **Free**: {free_gb:.1f} GB ({100-used_percent:.1f}% free)")
                info.append(f"- **Used**: {used_percent:.1f}%")
                
            except (PermissionError, OSError):
                continue  # Skip inaccessible drives
        
        return info
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 mentions the tool provides a 'comprehensive storage overview' and is 'critical for disk space management,' but fails to disclose key behavioral traits such as whether it requires elevated permissions, potential performance impact, data freshness, or output format. This leaves significant gaps for an agent to understand how to invoke it effectively.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized and front-loaded: the first sentence states the core purpose, followed by elaboration and context. It avoids redundancy and uses clear language. However, the second sentence ('Comprehensive storage overview...') slightly repeats information from the first, and the third sentence adds value but could be more integrated for optimal efficiency.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (a system analysis tool with no parameters and no output schema), the description provides basic purpose and usage context but lacks completeness. Without annotations or an output schema, it should ideally explain what the return data looks like (e.g., structured metrics, raw text) or any behavioral constraints. The description is adequate as a minimum viable explanation but has clear gaps for full contextual understanding.

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, with 100% schema description coverage (since there are no parameters to describe). In such cases, the baseline score is 4, as there is no need for the description to compensate for parameter documentation. The description appropriately focuses on the tool's purpose without unnecessary parameter details.

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 tool's purpose: 'Get disk and storage analysis - all partitions, capacity, usage.' It specifies the verb ('Get') and resource ('disk and storage analysis'), and the second sentence elaborates on scope ('all mounted volumes and usage stats'). However, it does not explicitly differentiate from sibling tools like 'get_hardware_details' or 'get_full_system_report', which might overlap in system monitoring contexts.

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

Usage Guidelines3/5

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

The description implies usage context with phrases like 'Critical for disk space management and storage troubleshooting,' suggesting when this tool is appropriate. However, it does not provide explicit guidance on when to use this tool versus alternatives (e.g., 'get_hardware_details' for broader hardware info or 'get_full_system_report' for comprehensive data), nor does it specify exclusions or prerequisites.

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/batteryshark/mcp-sysinfo'

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