Skip to main content
Glama

process_manager

Manage Windows processes by listing, monitoring, killing, and analyzing resource usage to optimize system performance and troubleshoot issues.

Instructions

Comprehensive process management including listing processes, getting process details, killing processes, and monitoring resource usage

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
actionYesThe process management action to perform
process_idNoProcess ID for specific process operations
process_nameNoProcess name for searching or filtering
sort_byNoSort processes by specified criteria (default: cpu)cpu
limitNoLimit number of results (default: 20)
include_systemNoInclude system processes (default: true)

Implementation Reference

  • The main handler function for the process_manager tool. It takes input arguments, switches on the 'action' parameter, and delegates to specific helper methods for process listing, details, killing, etc. Handles errors by returning an error response.
    async run(args: {
      action: string;
      process_id?: number;
      process_name?: string;
      sort_by?: string;
      limit?: number;
      include_system?: boolean;
    }) {
      try {
        switch (args.action) {
          case "list_processes":
            return await this.listProcesses(args.sort_by, args.limit, args.include_system);
          case "get_process_details":
            return await this.getProcessDetails(args.process_id, args.process_name);
          case "kill_process":
            return await this.killProcess(args.process_id, args.process_name);
          case "find_process":
            return await this.findProcess(args.process_name!);
          case "get_top_processes":
            return await this.getTopProcesses(args.sort_by, args.limit);
          case "get_process_tree":
            return await this.getProcessTree();
          default:
            throw new Error(`Unknown action: ${args.action}`);
        }
      } catch (error: any) {
        return {
          content: [{
            type: "text",
            text: `❌ Process management operation failed: ${error.message}`
          }],
          isError: true
        };
      }
    },
  • Input schema defining the parameters for the process_manager tool, including required 'action' and optional fields like process_id, sort_by, etc.
    parameters: {
      type: "object",
      properties: {
        action: {
          type: "string",
          enum: ["list_processes", "get_process_details", "kill_process", "find_process", "get_top_processes", "get_process_tree"],
          description: "The process management action to perform"
        },
        process_id: {
          type: "number",
          description: "Process ID for specific process operations"
        },
        process_name: {
          type: "string",
          description: "Process name for searching or filtering"
        },
        sort_by: {
          type: "string",
          enum: ["cpu", "memory", "name", "pid"],
          description: "Sort processes by specified criteria (default: cpu)",
          default: "cpu"
        },
        limit: {
          type: "number",
          description: "Limit number of results (default: 20)",
          default: 20
        },
        include_system: {
          type: "boolean",
          description: "Include system processes (default: true)",
          default: true
        }
      },
      required: ["action"]
    },
  • src/index.ts:32-36 (registration)
    Registration of the process_manager tool in the ListToolsRequestSchema handler, providing name, description, and inputSchema.
    {
      name: processManagerTool.name,
      description: processManagerTool.description,
      inputSchema: processManagerTool.parameters
    },
  • src/index.ts:73-74 (registration)
    Tool call dispatching in the CallToolRequestSchema handler: switches on tool name and calls processManagerTool.run().
    case "process_manager":
      return await processManagerTool.run(args as any);
  • Helper method to list processes, sorted by criteria, with limits and system process filtering, using PowerShell commands.
    async listProcesses(sortBy = "cpu", limit = 20, includeSystem = true) {
      try {
        const sortProperty = this.getSortProperty(sortBy);
        const systemFilter = includeSystem ? "" : "| Where-Object {$_.SessionId -ne 0}";
        
        const command = `Get-Process ${systemFilter} | Sort-Object ${sortProperty} -Descending | Select-Object -First ${limit} Name, Id, CPU, WorkingSet, VirtualMemorySize, SessionId, StartTime | Format-Table -AutoSize`;
        
        const { stdout } = await execAsync(`powershell -Command "${command}"`);
        
        return {
          content: [{
            type: "text",
            text: `# Process List\n\nSorted by: ${sortBy}\nLimit: ${limit}\nInclude System: ${includeSystem}\n\n\`\`\`\n${stdout}\n\`\`\``
          }]
        };
      } catch (error: any) {
        throw new Error(`Failed to list processes: ${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 full burden. It mentions 'killing processes' which implies destructive behavior, but doesn't disclose risks, permissions needed, or side effects. It also doesn't cover rate limits, response formats, or error handling for a multi-action tool.

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 the tool's scope. It lists key actions without unnecessary details, though it could be slightly more structured (e.g., bullet points) given the complexity.

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?

For a complex tool with 6 parameters, multiple actions including destructive ones, no annotations, and no output schema, the description is inadequate. It doesn't explain return values, error cases, or behavioral nuances, leaving significant gaps for an AI agent to use it correctly.

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 parameters are well-documented in the schema. The description adds minimal value by implying actions map to parameters but doesn't explain semantics beyond what's in the schema (e.g., how 'kill_process' differs from other actions). Baseline 3 is appropriate given high schema coverage.

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 as 'comprehensive process management' and lists specific actions (listing, getting details, killing, monitoring). It distinguishes from sibling tools like 'filesystem' or 'network' by focusing on processes, though it doesn't explicitly contrast with 'service_manager' or 'performance' which might overlap.

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?

No guidance on when to use this tool versus alternatives like 'service_manager' for services or 'performance' for monitoring. The description lists actions but doesn't specify contexts or prerequisites for choosing among them (e.g., when to kill vs. monitor).

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