get_running_applications
Retrieve a list of all currently running applications on macOS to monitor active processes and manage system resources.
Instructions
Получает список всех запущенных приложений на Mac
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "get_running_applications"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:419-445 (handler)TypeScript handler function that uses AppleScript via osascript to fetch and format the list of currently running Mac applications (non-background processes).
private async getRunningApplications() { try { // Получаем список запущенных приложений через AppleScript const { stdout } = await execAsync( `osascript -e 'tell application "System Events" to get name of every application process whose background only is false'` ); const apps = stdout .trim() .split(", ") .map((app) => app.trim()) .filter((app) => app.length > 0); return { content: [ { type: "text", text: `Запущенные приложения:\n${apps.join("\n")}`, }, ], }; } catch (error) { throw new Error( `Не удалось получить список приложений: ${error instanceof Error ? error.message : String(error)}` ); } } - src/server.py:328-337 (handler)Python handler function that uses AppleScript via osascript to fetch and format the list of currently running Mac applications (non-background processes).
def get_running_applications() -> str: """Gets list of running applications""" apple_script = 'tell application "System Events" to get name of every application process whose background only is false' stdout, stderr = exec_command(f'osascript -e \'{apple_script}\'') if stderr: raise Exception(f"Failed to get list of applications: {stderr}") apps = [app.strip() for app in stdout.strip().split(", ") if app.strip()] return "Running applications:\n" + "\n".join(apps) - src/index.ts:72-78 (schema)TypeScript tool schema definition including name, description, and empty input schema (no parameters required).
name: "get_running_applications", description: "Получает список всех запущенных приложений на Mac", inputSchema: { type: "object", properties: {}, }, }, - src/server.py:60-66 (schema)Python tool schema definition including name, description, and empty input schema (no parameters required).
"name": "get_running_applications", "description": "Gets list of all running applications on Mac", "inputSchema": { "type": "object", "properties": {}, }, }, - src/index.ts:311-312 (registration)TypeScript dispatch/registration in the CallToolRequestSchema handler that routes to the getRunningApplications method.
case "get_running_applications": return await this.getRunningApplications(); - src/server.py:597-598 (registration)Python dispatch/registration in the tools/call handler that calls the get_running_applications function.
elif tool_name == "get_running_applications": result_text = get_running_applications()