Quit App
quit_appQuit a running application on macOS by specifying its name.
Instructions
Quit a running application by name.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Application name (e.g. 'Safari') |
Implementation Reference
- src/system/tools.ts:604-621 (registration)Registration of the 'quit_app' tool on the MCP server with input schema (name parameter) and handler that calls quitAppScript via JXA.
server.registerTool( "quit_app", { title: "Quit App", description: "Quit a running application by name. May cause unsaved work to be lost.", inputSchema: { name: z.string().min(1).max(500).describe("Application name (e.g. 'Safari')"), }, annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: true, openWorldHint: false }, }, async ({ name }) => { try { return ok(await runJxa(quitAppScript(name))); } catch (e) { return errJxaFor("quit app", e); } }, ); - src/system/scripts.ts:315-321 (handler)The actual JXA script generator function that creates an AppleScript/JXA snippet to quit the specified application by name.
export function quitAppScript(name: string): string { return ` const app = Application('${esc(name)}'); app.quit(); JSON.stringify({quit: true, name: '${esc(name)}'}); `; } - src/system/tools.ts:609-612 (schema)Input schema for the quit_app tool, requiring a string 'name' parameter with min/max constraints.
inputSchema: { name: z.string().min(1).max(500).describe("Application name (e.g. 'Safari')"), }, annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: true, openWorldHint: false },