Skip to main content
Glama
NNNNzs

Server Status MCP Server

get_server_status

Retrieve CPU, memory, and uptime status of local or remote servers via SSH for real-time server monitoring and performance analysis.

Instructions

获取服务器的CPU、内存和运行状态

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
hostNo远程服务器地址或SSH配置中的主机名

Implementation Reference

  • index.ts:109-130 (registration)
    Registers the get_server_status tool with MCP server, including description, input schema (optional host), and inline handler for local server status.
    server.tool(
      "get_server_status",
      "获取服务器的CPU、内存和运行状态",
      {
        host: z.string().optional().describe("远程服务器地址或SSH配置中的主机名")
      },
      async () => {
        return {
          content: [{
            type: 'text',
            text: JSON.stringify({
              cpuCount: os.cpus().length,
              cpuRel: getLocalCpuUsage(),
              memory: os.freemem(),
              memoryUsage: ((1 - os.freemem() / os.totalmem()) * 100).toFixed(2) + '',
              uptime: os.uptime(),
              type: 'local'
            }, null, 2)
          }]
        };
      }
    );
  • Handler function that computes local server status: CPU count and relative usage (using getLocalCpuUsage helper), free memory, memory usage percentage, uptime, and type 'local', formatted as JSON in text content.
    async () => {
      return {
        content: [{
          type: 'text',
          text: JSON.stringify({
            cpuCount: os.cpus().length,
            cpuRel: getLocalCpuUsage(),
            memory: os.freemem(),
            memoryUsage: ((1 - os.freemem() / os.totalmem()) * 100).toFixed(2) + '',
            uptime: os.uptime(),
            type: 'local'
          }, null, 2)
        }]
      };
    }
  • Input schema for the tool: optional 'host' string parameter described as remote server address or SSH config hostname.
    {
      host: z.string().optional().describe("远程服务器地址或SSH配置中的主机名")
    },
  • Helper function to calculate local CPU usage percentage (idle time averaged across all CPUs). Called by the handler.
    export function getLocalCpuUsage() {
      const cpus = os.cpus();
      let totalIdle = 0, totalTick = 0;
      cpus.forEach((cpu) => {
        for (let type in cpu.times) {
          totalTick += cpu.times[type as keyof typeof cpu.times];
        }
        totalIdle += cpu.times.idle;
      });
      const idle = totalIdle / cpus.length;
      const total = totalTick / cpus.length;
      return 1 - idle / total;
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It describes the tool's function but lacks details on behavioral traits such as whether it requires authentication, has rate limits, returns real-time or cached data, or what happens if the host is unreachable. For a tool that interacts with remote servers, this is a significant gap.

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, efficient sentence that directly states the tool's purpose without unnecessary words. It's front-loaded with the core functionality, making it easy to understand quickly. Every part of the sentence contributes to clarifying what the tool does.

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 of server status retrieval and the lack of annotations and output schema, the description is incomplete. It doesn't cover behavioral aspects like error handling, data format, or performance implications. For a tool that likely involves network calls and system metrics, more context is needed to use it effectively.

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

Parameters3/5

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

The schema description coverage is 100%, with the single parameter 'host' documented as '远程服务器地址或SSH配置中的主机名' (remote server address or hostname in SSH configuration). The description doesn't add any additional meaning beyond this, as it doesn't mention parameters at all. With high schema coverage, the baseline score of 3 is appropriate.

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 tool's purpose: retrieving CPU, memory, and operational status of a server. It uses specific verbs ('获取' meaning 'get') and resources ('服务器的CPU、内存和运行状态' meaning 'server's CPU, memory, and running status'). However, it doesn't explicitly differentiate from the sibling tool 'get_remote_server_status', which appears to serve a similar purpose.

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. There's no mention of the sibling tool 'get_remote_server_status', nor any context about prerequisites, target environments, or specific use cases. It only states what the tool does, not when it should be selected.

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

Related 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/NNNNzs/server-status-mcp-server'

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