Skip to main content
Glama

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

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)

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