Skip to main content
Glama
Radek44
by Radek44

get_app_state

Retrieve the current application state, including running status, session information, and page details for Tauri desktop application automation and testing.

Instructions

Get the current state of the application, including whether it's running, session info, and page details

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Main tool handler: Fetches app state from driver, adds page title and URL if running, returns ToolResponse.
    export async function getAppState( driver: TauriDriver ): Promise<ToolResponse<{ isRunning: boolean; appPath?: string; sessionId?: string; pageTitle?: string; pageUrl?: string; }>> { try { const state = driver.getAppState(); let pageTitle: string | undefined; let pageUrl: string | undefined; if (state.isRunning) { try { pageTitle = await driver.getPageTitle(); pageUrl = await driver.getPageUrl(); } catch (error) { // Ignore errors getting page info } } return { success: true, data: { isRunning: state.isRunning, appPath: state.appPath, sessionId: state.sessionId, pageTitle, pageUrl, }, }; } catch (error) { return { success: false, error: error instanceof Error ? error.message : String(error), }; } }
  • Tool schema registration: Defines name, description, and empty input schema in ListTools response.
    { name: 'get_app_state', description: 'Get the current state of the application, including whether it\'s running, session info, and page details', inputSchema: { type: 'object', properties: {}, }, },
  • src/index.ts:322-332 (registration)
    Tool dispatch registration: Switch case in CallToolRequestHandler that invokes the getAppState handler.
    case 'get_app_state': { const result = await getAppState(driver); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2), }, ], }; }
  • Core helper: TauriDriver.getAppState() returns the internal app state.
    getAppState(): Readonly<AppState> { return { isRunning: this.appState.isRunning, browser: this.appState.browser, processId: this.appState.processId, appPath: this.appState.appPath, sessionId: this.appState.sessionId, }; }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Radek44/mcp-tauri-automation'

If you have feedback or need assistance with the MCP directory API, please join our Discord server