Skip to main content
Glama
dknell

System Information MCP Server

by dknell

get_disk_info_tool

Check disk usage on any specified path or all mounted disks to manage storage effectively.

Instructions

Retrieve disk usage information.

Args: path: Specific path to check (default: all mounted disks)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • Actual implementation of get_disk_info - retrieves disk usage information. If a specific path is given, gets usage for that mountpoint; otherwise iterates all partitions via psutil.disk_partitions(). Returns a dict with a 'disks' list containing mountpoint, device, fstype, total/used/free bytes, percent usage, and GB-converted values. Uses @cache_result decorator with 10s TTL.
    @cache_result("disk_info", ttl=10)
    def get_disk_info(path: Optional[str] = None) -> Dict[str, Any]:
        """Retrieve disk usage information."""
        try:
            disks = []
    
            if path:
                # Get info for specific path
                try:
                    usage = psutil.disk_usage(path)
                    disks.append(
                        {
                            "mountpoint": path,
                            "device": "N/A",
                            "fstype": "N/A",
                            "total": usage.total,
                            "used": usage.used,
                            "free": usage.free,
                            "percent": round((usage.used / usage.total) * 100, 1),
                            "total_gb": bytes_to_gb(usage.total),
                            "used_gb": bytes_to_gb(usage.used),
                            "free_gb": bytes_to_gb(usage.free),
                        }
                    )
                except (OSError, PermissionError) as e:
                    logger.warning(f"Could not get disk info for path {path}: {e}")
            else:
                # Get info for all mounted disks
                partitions = psutil.disk_partitions()
    
                for partition in partitions:
                    try:
                        usage = psutil.disk_usage(partition.mountpoint)
    
                        disks.append(
                            {
                                "mountpoint": partition.mountpoint,
                                "device": partition.device,
                                "fstype": partition.fstype,
                                "total": usage.total,
                                "used": usage.used,
                                "free": usage.free,
                                "percent": (
                                    round((usage.used / usage.total) * 100, 1)
                                    if usage.total
                                    else 0
                                ),
                                "total_gb": bytes_to_gb(usage.total),
                                "used_gb": bytes_to_gb(usage.used),
                                "free_gb": bytes_to_gb(usage.free),
                            }
                        )
                    except (OSError, PermissionError) as e:
                        logger.warning(
                            f"Could not get usage for {partition.mountpoint}: {e}"
                        )
                        continue
    
            return {"disks": disks}
    
        except Exception as e:
            logger.error(f"Error getting disk info: {e}")
            raise
  • Type signature: get_disk_info(path: Optional[str] = None) -> Dict[str, Any] - the path parameter is optional; when None all mounted disks are returned.
    def get_disk_info(path: Optional[str] = None) -> Dict[str, Any]:
  • Tool registration via @app.tool() decorator. get_disk_info_tool is the MCP tool wrapper that delegates to get_disk_info(path=path) from the tools module.
    @app.tool()
    def get_disk_info_tool(path: Optional[str] = None) -> Dict[str, Any]:
        """Retrieve disk usage information.
    
        Args:
            path: Specific path to check (default: all mounted disks)
        """
        return get_disk_info(path=path)
  • Import of get_disk_info from .tools module into the server.py where the tool is registered.
    from .tools import (
        get_cpu_info,
        get_memory_info,
        get_disk_info,
        get_network_info,
        get_process_list,
        get_system_uptime,
        get_temperature_info,
    )
  • get_disk_info is also imported in resources.py and used in get_system_overview() to build a comprehensive system snapshot resource.
    get_disk_info,
Behavior2/5

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

No annotations exist, so the description carries full burden. It does not disclose whether the operation is read-only, has side effects, requires permissions, or any performance implications. The read-only nature can be inferred from the tool's name and purpose, but explicit disclosure is lacking.

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 concise with one main sentence and an 'Args' block for the parameter. It is front-loaded with the purpose, and the parameter documentation is minimal yet sufficient. No wasted sentences.

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?

The tool has an output schema, so return values need not be described. However, the description lacks details about potential errors, behavior on invalid paths, or whether it requires elevated privileges. For a simple informational tool, it is functional but leaves some gaps given no annotations.

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?

With schema description coverage at 0%, the description compensates by explaining the 'path' parameter: 'Specific path to check (default: all mounted disks)'. This adds meaning beyond the raw schema, clarifying optionality and default behavior.

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 states 'Retrieve disk usage information', which clearly identifies the resource (disk usage) and action (retrieve). It distinguishes from siblings like get_cpu_info_tool by specifying disk-specific functionality.

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?

No guidance on when to use this tool versus alternatives (e.g., other system info tools). No prerequisites, exclusions, or recommended contexts are provided.

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/dknell/mcp-system-info'

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