Skip to main content
Glama

performance

Monitor Windows system performance by tracking CPU, memory, disk I/O, network activity, and performance counters to identify resource usage and bottlenecks.

Instructions

System performance monitoring including CPU usage, memory usage, disk I/O, network I/O, and system performance counters

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
actionYesThe performance monitoring action to perform
durationNoDuration in seconds for monitoring (default: 10)
intervalNoInterval in seconds between measurements (default: 1)
process_countNoNumber of top processes to show (default: 10)
counter_nameNoSpecific performance counter name to query

Implementation Reference

  • The main execution handler for the 'performance' tool. It switches on the 'action' parameter to call specific performance monitoring methods.
    async run(args: {
      action: string;
      duration?: number;
      interval?: number;
      process_count?: number;
      counter_name?: string;
    }) {
      try {
        switch (args.action) {
          case "get_cpu_usage":
            return await this.getCpuUsage(args.duration);
          case "get_memory_usage":
            return await this.getMemoryUsage();
          case "get_disk_usage":
            return await this.getDiskUsage();
          case "get_disk_io":
            return await this.getDiskIO();
          case "get_network_io":
            return await this.getNetworkIO();
          case "get_system_performance":
            return await this.getSystemPerformance();
          case "get_top_processes_by_cpu":
            return await this.getTopProcessesByCpu(args.process_count);
          case "get_top_processes_by_memory":
            return await this.getTopProcessesByMemory(args.process_count);
          case "get_performance_counters":
            return await this.getPerformanceCounters(args.counter_name);
          case "monitor_real_time":
            return await this.monitorRealTime(args.duration, args.interval);
          default:
            throw new Error(`Unknown action: ${args.action}`);
        }
      } catch (error: any) {
        return {
          content: [{
            type: "text",
            text: `❌ Performance monitoring operation failed: ${error.message}`
          }],
          isError: true
        };
      }
    },
  • Input schema (parameters) for the 'performance' tool, defining the action enum and supporting parameters.
    parameters: {
      type: "object",
      properties: {
        action: {
          type: "string",
          enum: ["get_cpu_usage", "get_memory_usage", "get_disk_usage", "get_disk_io", "get_network_io", "get_system_performance", "get_top_processes_by_cpu", "get_top_processes_by_memory", "get_performance_counters", "monitor_real_time"],
          description: "The performance monitoring action to perform"
        },
        duration: {
          type: "number",
          description: "Duration in seconds for monitoring (default: 10)",
          default: 10
        },
        interval: {
          type: "number",
          description: "Interval in seconds between measurements (default: 1)",
          default: 1
        },
        process_count: {
          type: "number",
          description: "Number of top processes to show (default: 10)",
          default: 10
        },
        counter_name: {
          type: "string",
          description: "Specific performance counter name to query"
        }
      },
      required: ["action"]
    },
  • src/index.ts:57-61 (registration)
    Registration of the 'performance' tool in the ListToolsRequestSchema handler.
    {
      name: performanceTool.name,
      description: performanceTool.description,
      inputSchema: performanceTool.parameters
    }
  • src/index.ts:83-84 (registration)
    Dispatch case in the CallToolRequestSchema handler that executes the 'performance' tool.
    case "performance":
      return await performanceTool.run(args as any);
  • Example helper function for getting CPU usage, one of the sub-handlers called by the main run method.
    async getCpuUsage(duration = 10) {
      try {
        // Get current CPU info
        const cpus = os.cpus();
        const cpuCount = cpus.length;
        const cpuModel = cpus[0].model;
        
        // Get CPU usage using PowerShell
        const command = `Get-Counter "\\Processor(_Total)\\% Processor Time" -SampleInterval 1 -MaxSamples ${duration} | Select-Object -ExpandProperty CounterSamples | Select-Object CookedValue | Measure-Object -Property CookedValue -Average -Maximum -Minimum`;
        const { stdout } = await execAsync(`powershell -Command "${command}"`);
        
        // Get per-core usage
        const coreCommand = `Get-Counter "\\Processor(*)\\% Processor Time" -MaxSamples 1 | Select-Object -ExpandProperty CounterSamples | Where-Object {$_.InstanceName -ne '_total'} | Select-Object InstanceName, CookedValue | Format-Table -AutoSize`;
        const { stdout: coreUsage } = await execAsync(`powershell -Command "${coreCommand}"`);
        
        const result = `# CPU Usage Analysis\n\n## CPU Information\n` +
          `- **Model**: ${cpuModel}\n` +
          `- **Cores**: ${cpuCount}\n` +
          `- **Monitoring Duration**: ${duration} seconds\n\n` +
          `## Overall CPU Usage Statistics\n\`\`\`\n${stdout}\n\`\`\`\n\n` +
          `## Per-Core Usage (Current)\n\`\`\`\n${coreUsage}\n\`\`\``;
        
        return {
          content: [{ type: "text", text: result }]
        };
      } catch (error: any) {
        throw new Error(`Failed to get CPU usage: ${error.message}`);
      }
    },
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. It mentions 'monitoring' but lacks details on behavioral traits: it doesn't specify if this is read-only, requires admin permissions, has rate limits, returns real-time vs. aggregated data, or handles errors. The description is too vague for a tool with multiple actions and parameters.

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

Conciseness4/5

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

The description is a single, efficient sentence that front-loads key information: 'System performance monitoring' followed by specific components. It's appropriately sized with no wasted words, though it could be slightly more structured to highlight core vs. optional features.

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 tool's complexity (5 parameters, multiple actions, no output schema, and no annotations), the description is incomplete. It doesn't address behavioral aspects, output format, or usage scenarios. For a performance monitoring tool with diverse actions, more context is needed to guide effective use.

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?

Schema description coverage is 100%, so the schema already documents all 5 parameters well. The description adds minimal value beyond the schema—it lists monitoring areas (CPU, memory, etc.) which loosely map to the 'action' enum but doesn't explain parameter interactions or usage contexts. Baseline 3 is appropriate as the schema does the heavy lifting.

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: 'System performance monitoring including CPU usage, memory usage, disk I/O, network I/O, and system performance counters.' It specifies the verb ('monitoring') and resources (CPU, memory, disk, network, performance counters). However, it doesn't explicitly differentiate from sibling tools like 'system_info' or 'process_manager,' which might overlap in functionality.

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 lists what it monitors but doesn't specify scenarios, prerequisites, or exclusions. For example, it doesn't clarify if this is for real-time monitoring, historical data, or how it differs from 'system_info' or 'process_manager' siblings.

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/guangxiangdebizi/windows-system-mcp'

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