close_app
Gracefully terminate the currently running Tauri desktop application to complete automation workflows or end testing sessions.
Instructions
Close the currently running Tauri application gracefully
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": "close_app"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/launch.ts:37-55 (handler)Primary handler function for the 'close_app' tool. Executes driver.closeApp() and returns 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 MCP server's ListToolsResponse, defining name, description, and input schema (no required params).
{ name: 'close_app', description: 'Close the currently running Tauri application gracefully', inputSchema: { type: 'object', properties: {}, }, }, - src/index.ts:220-230 (handler)MCP server dispatcher for 'close_app' tool calls, invokes the handler and returns JSON-formatted 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 TauriDriver.closeApp() method that terminates the WebDriver session and resets application state.
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; } }