Skip to main content
Glama
dknell

System Information MCP Server

by dknell

get_disk_info_tool

Retrieve disk usage information for mounted disks or specific paths to monitor storage capacity and availability.

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

  • The handler function for get_disk_info_tool, registered with @app.tool(), which calls the underlying get_disk_info implementation.
    @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)
  • Core helper function implementing the disk information logic using psutil.disk_usage and disk_partitions, with error handling and formatting.
    @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
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool retrieves information, implying a read-only operation, but doesn't specify permissions required, rate limits, output format, or whether it's safe to run frequently. This leaves significant gaps in understanding how the tool behaves beyond its basic function.

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

Conciseness5/5

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

The description is extremely concise and well-structured: a clear purpose statement followed by a brief parameter explanation. Every sentence adds value without redundancy, and it's front-loaded with the main function. There's no wasted text, making it efficient for quick understanding.

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 low complexity (one optional parameter) and the presence of an output schema, the description is adequate but not complete. It covers the basic purpose and parameter semantics, but lacks behavioral details like permissions or usage context. The output schema likely handles return values, so the description doesn't need to explain those.

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 description adds meaningful context beyond the schema: it explains that the 'path' parameter is for a specific path to check and defaults to all mounted disks. With 0% schema description coverage and only one parameter, this compensates well by clarifying the parameter's purpose and default behavior, though it doesn't detail path format or constraints.

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 verb 'retrieve' and resource 'disk usage information', making the purpose immediately understandable. It distinguishes this tool from siblings like get_cpu_info_tool and get_memory_info_tool by specifying it deals with disk data. However, it doesn't specify the format or granularity of the information retrieved, keeping it from a perfect score.

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?

The description provides no guidance on when to use this tool versus alternatives. While siblings exist for other system metrics, there's no mention of when disk info is needed over CPU or memory info, nor any prerequisites or exclusions for usage. The only implicit context is that it's for disk-related queries.

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