Skip to main content
Glama

get_running_services

Retrieve information about currently running services on Windows systems, with filtering options by service name and status for system monitoring and management.

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

NameRequiredDescriptionDefault
nameNo
statusNo
timeoutNo

Input Schema (JSON Schema)

{ "properties": { "name": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Name" }, "status": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Status" }, "timeout": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": 60, "title": "Timeout" } }, "type": "object" }

Implementation Reference

  • The handler function for the 'get_running_services' tool. It constructs a PowerShell 'Get-Service' command with optional filters for service name and status, selects specific properties, formats the output as JSON, and executes it using the shared execute_powershell helper.
    @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)

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