Skip to main content
Glama
DynamicEndpoints

PowerShell Exec MCP Server

get_processes

Retrieve details about active processes on a system, with options to filter by name, sort by resource usage, and limit results for monitoring and troubleshooting.

Instructions

Get information about running processes.

Args:
    name: Filter processes by name (supports wildcards)
    top: Limit to top N processes
    sort_by: Property to sort by (e.g., CPU, WorkingSet)
    timeout: Command timeout in seconds (1-300, default 60)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameNo
topNo
sort_byNo
timeoutNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The @mcp.tool()-decorated handler function implementing the 'get_processes' tool. Constructs a filtered PowerShell 'Get-Process' command, formats output for JSON, and executes it securely.
    @mcp.tool()
    async def get_processes(name: Optional[str] = None, top: Optional[int] = None, sort_by: Optional[str] = None, timeout: Optional[int] = 60) -> str:
        """Get information about running processes.
        
        Args:
            name: Filter processes by name (supports wildcards)
            top: Limit to top N processes
            sort_by: Property to sort by (e.g., CPU, WorkingSet)
            timeout: Command timeout in seconds (1-300, default 60)
        """
        code = "Get-Process"
        if name:
            code = f"{code} -Name '{name}'"
        if sort_by:
            code = f"{code} | Sort-Object -Property {sort_by} -Descending"
        if top:
            code = f"{code} | Select-Object -First {top}"
        code = f"{code} | Select-Object Name, Id, CPU, WorkingSet, StartTime"
        return await execute_powershell(format_json_output(code), timeout)
Behavior3/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 describes what the tool does (get process information) and includes parameter details that hint at behavior (filtering, sorting, timeout). However, it lacks critical behavioral details: whether this requires admin privileges, what format the output returns, if it's read-only, potential side effects, or error conditions. The timeout parameter description adds some behavioral context but doesn't fully compensate for missing annotations.

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 well-structured and appropriately sized. The first sentence states the purpose clearly, followed by a parameter section with concise explanations. Every sentence earns its place, though the formatting with 'Args:' and bullet-like structure could be slightly more polished for maximum clarity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given that there's an output schema (which handles return values), no annotations, and good parameter coverage in the description, the description is reasonably complete. It covers the tool's purpose and all parameters thoroughly. The main gap is lack of behavioral context (permissions, side effects) and usage guidance relative to siblings, but the output schema reduces the need to describe return values.

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

Parameters5/5

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

Schema description coverage is 0%, so the description must fully compensate. It provides excellent parameter semantics: explains what each parameter does, includes examples (e.g., 'CPU, WorkingSet' for sort_by), specifies constraints ('1-300, default 60' for timeout), and mentions features like wildcard support. This adds substantial value beyond the bare schema.

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: 'Get information about running processes.' This is a specific verb+resource combination that distinguishes it from sibling tools like get_event_logs or get_system_info. However, it doesn't explicitly differentiate from get_running_services, which might be a related sibling.

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 doesn't mention sibling tools like get_running_services or get_system_info, nor does it specify scenarios where this tool is preferred. The only implicit guidance is through parameter descriptions, but no explicit usage context is provided.

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/DynamicEndpoints/PowerShell-Exec-MCP-Server'

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