get_running_services
Retrieve and filter currently running services on Windows systems by name or status for system monitoring and management tasks.
Instructions
Get information about running services.
Args:
name: Filter services by name (supports wildcards)
status: Filter by status (Running, Stopped, etc.)
timeout: Command timeout in seconds (1-300, default 60)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | ||
| status | No | ||
| timeout | No |
Implementation Reference
- src/server.py:92-110 (handler)Handler function that implements the get_running_services tool by constructing and executing a filtered PowerShell 'Get-Service' command, returning JSON-formatted service information.@mcp.tool() async def get_running_services(name: Optional[str] = None, status: Optional[str] = None, timeout: Optional[int] = 60) -> str: """Get information about running services. Args: name: Filter services by name (supports wildcards) status: Filter by status (Running, Stopped, etc.) timeout: Command timeout in seconds (1-300, default 60) """ code = "Get-Service" filters = [] if name: filters.append(f"Name -like '{name}'") if status: filters.append(f"Status -eq '{status}'") if filters: code = f"{code} | Where-Object {{ {' -and '.join(filters)} }}" code = f"{code} | Select-Object Name, DisplayName, Status, StartType" return await execute_powershell(format_json_output(code), timeout)