Skip to main content
Glama
gunjanjp

Linux Bash MCP Server

by gunjanjp

get_system_info

Retrieve system details from WSL2 Linux environments to monitor performance, check configurations, and troubleshoot issues through the Linux Bash MCP Server.

Instructions

Get system information about the WSL2 Linux environment

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for 'get_system_info' that executes a series of Linux system commands via WSL (uname, os-release, df, free, uptime, etc.) and returns a structured JSON response with the results.
    async getSystemInfo() {
      if (!this.wslDistribution) {
        throw new Error("WSL distribution not configured");
      }
      
      try {
        const commands = [
          { cmd: "uname -a", desc: "System information" },
          { cmd: "cat /etc/os-release", desc: "OS release information" },
          { cmd: "whoami", desc: "Current user" },
          { cmd: "pwd", desc: "Current directory" },
          { cmd: "df -h", desc: "Disk usage" },
          { cmd: "free -h", desc: "Memory usage" },
          { cmd: "uptime", desc: "System uptime" },
          { cmd: "cat /proc/version", desc: "Kernel version" }
        ];
        
        const results = {};
        
        for (const { cmd, desc } of commands) {
          try {
            const wslCommand = `wsl -d ${this.wslDistribution} -- ${cmd}`;
            const { stdout } = await execAsync(wslCommand);
            results[desc] = {
              command: cmd,
              output: stdout.trim()
            };
          } catch (error) {
            results[desc] = {
              command: cmd,
              error: error.message
            };
          }
        }
    
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify({
                success: true,
                wslDistribution: this.wslDistribution,
                systemInfo: results,
                timestamp: new Date().toISOString()
              }, null, 2),
            },
          ],
        };
      } catch (error) {
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify({
                success: false,
                wslDistribution: this.wslDistribution,
                error: error.message,
                timestamp: new Date().toISOString()
              }, null, 2),
            },
          ],
        };
      }
    }
  • The input schema for the get_system_info tool, which requires no parameters (empty properties).
    inputSchema: {
      type: "object",
      properties: {},
    },
  • src/index.js:256-263 (registration)
    Registration of the 'get_system_info' tool in the ListTools response, including name, description, and schema.
    {
      name: "get_system_info",
      description: "Get system information about the WSL2 Linux environment",
      inputSchema: {
        type: "object",
        properties: {},
      },
    },
  • src/index.js:290-291 (registration)
    Dispatch case in the CallToolRequestSchema handler that routes 'get_system_info' calls to the getSystemInfo method.
    case "get_system_info":
      return await this.getSystemInfo();
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. While 'Get' implies a read-only operation, it doesn't specify what kind of system information is returned (hardware, software, configuration), whether there are permission requirements, rate limits, or error conditions. The description is too vague about the actual behavior.

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 a single, focused sentence that states exactly what the tool does with no unnecessary words. It's perfectly front-loaded and wastes no space on redundant information.

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 zero-parameter read tool with no output schema, the description provides the basic purpose but lacks important context about what information is returned, format, or any behavioral constraints. Given the absence of annotations and output schema, more detail about the return value would be helpful for an agent to understand what to expect.

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 zero parameters with 100% schema description coverage, so the schema already fully documents the parameter situation. The description appropriately doesn't mention parameters since none exist, which is correct. Baseline for zero parameters is 4.

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 'Get' and the resource 'system information about the WSL2 Linux environment', making the purpose immediately understandable. It doesn't explicitly distinguish from sibling tools like 'check_wsl_status' or 'execute_bash_command', but the specific focus on system information provides reasonable differentiation.

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 like 'check_wsl_status' (which might provide status rather than detailed information) or other sibling tools. There's no mention of prerequisites, typical use cases, or limitations that would help an agent choose appropriately.

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/gunjanjp/linuxshell-mcp'

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