Skip to main content
Glama
jsebgiraldo

OpenWRT SSH MCP Server

by jsebgiraldo

openwrt_get_system_info

Retrieve system status details like board information, uptime, memory usage, and CPU load from an OpenWRT router via SSH for monitoring and troubleshooting.

Instructions

Get comprehensive system information including board details, uptime, memory usage, and CPU load

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main implementation of get_system_info() in the OpenWRTTools class. Executes multiple commands (ubus call system board, ubus call system info, cat /proc/uptime, cat /proc/loadavg) to gather comprehensive system information, parses JSON output from ubus commands, and returns a structured response with board details, system info, uptime, and load average.
    @staticmethod
    async def get_system_info() -> dict[str, Any]:
        """
        Get OpenWRT system information (uptime, memory, load).
        
        Returns:
            dict: System information
        """
        try:
            await ssh_client.ensure_connected()
    
            # Execute multiple commands to gather system info
            commands = {
                "board": "ubus call system board",
                "info": "ubus call system info",
                "uptime": "cat /proc/uptime",
                "loadavg": "cat /proc/loadavg",
            }
    
            results = {}
            for key, cmd in commands.items():
                result = await ssh_client.execute(cmd)
                if result["success"]:
                    if key in ["board", "info"]:
                        # Parse JSON output from ubus
                        try:
                            results[key] = json.loads(result["stdout"])
                        except json.JSONDecodeError:
                            results[key] = result["stdout"]
                    else:
                        results[key] = result["stdout"]
                else:
                    results[key] = {"error": result["stderr"]}
    
            return {
                "success": True,
                "system_info": results,
            }
    
        except Exception as e:
            logger.error(f"Failed to get system info: {e}")
            return {
                "success": False,
                "error": str(e),
            }
  • Tool registration schema defining openwrt_get_system_info with name, description, and inputSchema. The tool accepts no input parameters (empty properties and required arrays) and returns comprehensive system information including board details, uptime, memory usage, and CPU load.
    Tool(
        name="openwrt_get_system_info",
        description=(
            "Get comprehensive system information including board details, "
            "uptime, memory usage, and CPU load"
        ),
        inputSchema={
            "type": "object",
            "properties": {},
            "required": [],
        },
    ),
  • Routing logic in the call_tool handler that maps 'openwrt_get_system_info' requests to the OpenWRTTools.get_system_info() method implementation.
    elif name == "openwrt_get_system_info":
        result = await OpenWRTTools.get_system_info()
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states this is a read operation ('Get'), but doesn't disclose behavioral traits like whether it requires authentication, rate limits, network connectivity needs, or what happens on failure. For a tool with zero annotation coverage, this leaves significant gaps in understanding how it behaves.

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?

Single sentence efficiently conveys purpose with specific examples. No wasted words, front-loaded with the core action ('Get comprehensive system information'), followed by illustrative details. Perfectly sized for a no-parameter read tool.

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?

For a read-only tool with no parameters and no output schema, the description adequately covers what information is retrieved. However, without annotations or output schema, it doesn't address format of returned data, error conditions, or dependencies. Given the complexity is low (simple system query), it's minimally complete but could benefit from more behavioral context.

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, so the schema fully documents the absence of inputs. The description appropriately doesn't discuss parameters, maintaining focus on what information is retrieved rather than how to configure the request.

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

Purpose5/5

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

The description clearly states the verb 'Get' and specifies the resource 'comprehensive system information' with concrete examples (board details, uptime, memory usage, CPU load). It distinguishes from siblings like openwrt_get_firewall_rules or openwrt_get_wifi_status by focusing on overall system metrics rather than specific subsystems.

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 for monitoring system health or diagnostics, but doesn't explicitly state when to use this versus alternatives like openwrt_execute_command for custom queries or openwrt_get_wifi_status for network-specific info. No explicit exclusions or prerequisites are mentioned.

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/jsebgiraldo/openwrt_ssh_mcp'

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