close_app
Close the currently running Tauri desktop application to end automation sessions and free system resources.
Instructions
Close the currently running Tauri application gracefully
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/launch.ts:37-55 (handler)The exported closeApp function that serves as the primary tool handler. It calls the driver's closeApp method and returns a standardized ToolResponse.export async function closeApp( driver: TauriDriver ): Promise<ToolResponse<{ message: string }>> { try { await driver.closeApp(); return { success: true, data: { message: 'Application closed successfully', }, }; } catch (error) { return { success: false, error: error instanceof Error ? error.message : String(error), }; } }
- src/index.ts:76-83 (registration)Tool registration in the MCP server's listTools handler, defining name, description, and input schema (no parameters required).{ name: 'close_app', description: 'Close the currently running Tauri application gracefully', inputSchema: { type: 'object', properties: {}, }, },
- src/index.ts:220-230 (handler)MCP callTool dispatch for 'close_app', invoking the tool handler and formatting the response.case 'close_app': { const result = await closeApp(driver); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2), }, ], }; }
- src/tauri-driver.ts:79-94 (helper)Core implementation in TauriDriver that closes the WebDriver session, effectively shutting down the Tauri app.async closeApp(): Promise<void> { if (!this.appState.browser || !this.appState.isRunning) { throw new Error('No application is currently running'); } try { await this.appState.browser.deleteSession(); } catch (error) { console.error('Error closing browser session:', error); } finally { this.appState.browser = null; this.appState.isRunning = false; this.appState.sessionId = undefined; this.appState.appPath = undefined; } }