Skip to main content
Glama
DynamicEndpoints

PowerShell Exec MCP Server

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
NameRequiredDescriptionDefault
nameNo
statusNo
timeoutNo

Implementation Reference

  • 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)

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