Skip to main content
Glama
Heht571
by Heht571

get_system_load

Retrieve system load information from remote servers to monitor performance and identify potential bottlenecks.

Instructions

获取系统负载信息

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
hostnameYes
usernameYes
passwordNo
portNo
timeoutNo

Implementation Reference

  • Core handler implementation for the get_system_load tool. Uses SSH to execute 'uptime' command and parse load average.
    @handle_exceptions
    def get_system_load(
        hostname: str,
        username: str,
        password: str = "",
        port: int = 22,
        timeout: int = 30
    ) -> dict:
        """获取系统负载信息"""
        try:
            with SSHManager(hostname, username, password, port, timeout) as ssh:
                stdin, stdout, stderr = ssh.exec_command("uptime")
                load_output = stdout.read().decode().strip()
                load_avg = re.search(r'load average: (.*)', load_output)
                return {"status": "success", "load_average": load_avg.group(1) if load_avg else "unknown"}
        except Exception as e:
            return {"status": "error", "error": str(e)}
  • Core handler implementation for the get_system_load tool in SSE variant. Identical logic using SSH 'uptime'.
    @handle_exceptions
    def get_system_load(
        hostname: str,
        username: str,
        password: str = "",
        port: int = 22,
        timeout: int = 30
    ) -> dict:
        """获取系统负载信息"""
        try:
            with SSHManager(hostname, username, password, port, timeout) as ssh:
                stdin, stdout, stderr = ssh.exec_command("uptime")
                load_output = stdout.read().decode().strip()
                load_avg = re.search(r'load average: (.*)', load_output)
                return {"status": "success", "load_average": load_avg.group(1) if load_avg else "unknown"}
        except Exception as e:
            return {"status": "error", "error": str(e)}
  • Tool registration in FastMCP server, including get_system_load in tools_dict and dynamic @mcp.tool() decoration.
    tools_dict = {
        'get_memory_info': get_memory_info,
        'remote_server_inspection': remote_server_inspection,
        'get_system_load': get_system_load,
        'monitor_processes': monitor_processes,
        'check_service_status': check_service_status,
        'get_os_details': get_os_details,
        'check_ssh_risk_logins': check_ssh_risk_logins,
        'check_firewall_config': check_firewall_config,
        'security_vulnerability_scan': security_vulnerability_scan,
        'backup_critical_files': backup_critical_files,
        'inspect_network': inspect_network,
        'analyze_logs': analyze_logs,
        'list_docker_containers': list_docker_containers,
        'list_docker_images': list_docker_images,
        'list_docker_volumes': list_docker_volumes,
        'get_container_logs': get_container_logs,
        'monitor_container_stats': monitor_container_stats,
        'check_docker_health': check_docker_health
    }
    
    # 使用装饰器动态注册所有工具
    for name, func in tools_dict.items():
        mcp.tool()(func)
  • Manual dispatcher/registration case for get_system_load tool call in SSE server handler.
    elif name == "get_system_load":
        required_args = ["hostname", "username"]
        for arg in required_args:
            if arg not in arguments:
                raise ValueError(f"Missing required argument '{arg}'")
    
        result = get_system_load(
            hostname=arguments["hostname"],
            username=arguments["username"],
            password=arguments.get("password", ""),
            port=arguments.get("port", 22),
            timeout=arguments.get("timeout", 30)
        )
  • JSON schema definition for get_system_load tool parameters and description used in list_available_tools.
    {"name": "get_system_load", "description": "获取系统负载信息", "parameters": [
        {"name": "hostname", "type": "str", "default": None},
        {"name": "username", "type": "str", "default": None},
        {"name": "password", "type": "str", "default": ""},
        {"name": "port", "type": "int", "default": 22},
        {"name": "timeout", "type": "int", "default": 30}
    ]},
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 only states the purpose without revealing that this likely involves remote SSH access (implied by hostname, username, password parameters), potential authentication requirements, timeout behavior, or what the output format might be. This is inadequate for a tool with multiple parameters and no output schema.

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 with a single phrase, '获取系统负载信息', which is front-loaded and wastes no words. While it may be too brief for completeness, it earns full marks for conciseness as every word contributes directly to the purpose.

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

Completeness2/5

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

Given the complexity (5 parameters, no annotations, no output schema), the description is incomplete. It doesn't explain the remote access nature, parameter roles, expected output, or error conditions. For a tool that likely performs system monitoring via SSH, this leaves significant gaps in understanding how to use it effectively.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate by explaining parameters, but it adds no semantic information beyond the tool's name. Parameters like hostname, username, password, port, and timeout are undocumented in both schema and description, leaving their purposes and formats unclear. This fails to address the coverage gap.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description '获取系统负载信息' (Get system load information) states what the tool does but is vague about scope and method. It doesn't specify what 'system load' includes (CPU, memory, processes) or how it's obtained (local vs remote). While it distinguishes from some siblings like 'get_memory_info' by focusing on load, it lacks the specificity needed for a higher 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. It doesn't mention prerequisites like SSH access, compare to similar tools (e.g., 'get_memory_info' for memory-specific data), or indicate scenarios where it's appropriate. This leaves the agent with little context for selection.

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/Heht571/ops-mcp-server'

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