Skip to main content
Glama
by Radek44

get_app_state

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

Instructions

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

Input Schema

NameRequiredDescriptionDefault

No arguments

Input Schema (JSON Schema)

{ "properties": {}, "type": "object" }

Implementation Reference

  • Main tool handler: exports async getAppState which fetches app state from driver, adds page title/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), }; } }
  • src/index.ts:322-332 (registration)
    Registration in CallToolRequestSchema handler: switch case that calls the getAppState tool handler.
    case 'get_app_state': { const result = await getAppState(driver); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2), }, ], }; }
  • Tool schema: definition in ListToolsRequestSchema response, no input params required.
    { 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: {}, }, },
  • Helper method on TauriDriver: returns the internal app state object.
    getAppState(): Readonly<AppState> { return { isRunning: this.appState.isRunning, browser: this.appState.browser, processId: this.appState.processId, appPath: this.appState.appPath, sessionId: this.appState.sessionId, }; }
  • src/index.ts:17-17 (registration)
    Import of the getAppState tool handler.
    import { launchApp, closeApp, getAppState } from './tools/launch.js';

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