get_running_applications
Retrieve a list of all currently running applications on macOS to monitor system activity or manage processes.
Instructions
Получает список всех запущенных приложений на Mac
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:419-445 (handler)TypeScript handler for get_running_applications tool. Executes AppleScript via osascript to retrieve names of running foreground application processes, formats them into a list, and returns as MCP content response.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 for get_running_applications tool. Executes AppleScript via osascript using exec_command helper to get running foreground apps, parses output, and returns formatted list string.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 input schema definition for the get_running_applications tool in the tools list response. No input parameters required.name: "get_running_applications", description: "Получает список всех запущенных приложений на Mac", inputSchema: { type: "object", properties: {}, }, },
- src/server.py:60-66 (schema)Python input schema definition for the get_running_applications tool returned by get_tools() function."name": "get_running_applications", "description": "Gets list of all running applications on Mac", "inputSchema": { "type": "object", "properties": {}, }, },
- src/index.ts:311-312 (registration)TypeScript tool dispatcher/registration in the CallToolRequestSchema handler switch statement, which calls the getRunningApplications handler.case "get_running_applications": return await this.getRunningApplications();