get_session_status
Check the current session status of a Tauri app. Optionally probe bridge health per window to verify connectivity.
Instructions
Check session (app) status. Use probe_bridge to verify bridge health per window.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| probe_bridge | No | Actively probe bridge health per window (adds latency) |
Implementation Reference
- Handler function for the get_session_status tool. Gathers session status from the TauriManager (status, app config, PID, launch time, project root) and optionally probes bridge health via SocketManager. Returns a JSON stringified result.
get_session_status: async (args: { probe_bridge?: boolean }) => { const status = tauriManager.getStatus(); const config = tauriManager.getAppConfig(); const pid = tauriManager.getProcessPid(); const launchedAt = tauriManager.getLaunchedAt(); const projectRoot = tauriManager.getProjectRoot(); const result: Record<string, unknown> = { status, app: config ? { name: config.packageName, binary: config.binaryName, directory: config.appDir, } : null, ...(pid != null && { pid }), ...(launchedAt != null && { launchedAt }), projectRoot, }; // When running and probe requested, check bridge health per window if (status === 'running' && args.probe_bridge) { try { result.bridge = await socketManager.probeBridge(); } catch { // Socket dead or probe failed — omit bridge field (backward compatible) } } return { content: [ { type: 'text' as const, text: JSON.stringify(result, null, 2), }, ], }; }, - Zod schema for get_session_status tool: defines name, description, and input schema with optional 'probe_bridge' boolean parameter.
get_session_status: { name: 'get_session_status', description: 'Check session (app) status. Use probe_bridge to verify bridge health per window.', inputSchema: z.object({ probe_bridge: z.boolean().optional().default(false).describe('Actively probe bridge health per window (adds latency)'), }), }, - packages/tauri-mcp/src/server.ts:14-16 (registration)get_session_status is listed as a default essential tool in DEFAULT_ESSENTIAL_TOOLS. Tools listed here are shown by default unless ESSENTIAL_TOOLS env var overrides.
const DEFAULT_ESSENTIAL_TOOLS = [ 'get_session_status', 'start_session', - Helper method getStatus() on TauriManager used by the handler to determine the current app status (running/starting/not_running).
getStatus(): AppStatus { if (this.process) { if (this.detectedPipePath || this.detectedUnixSocketPath || this.isSocketReady()) { return 'running'; } return 'starting'; } return 'not_running'; } - Helper method probeBridge() on SocketManager used by the handler when probe_bridge is true. Sends a 'probe_bridge' command via socket to check bridge health per window.
async probeBridge(windowLabel?: string): Promise<Record<string, { initialized: boolean; bridge_alive: boolean }>> { const params: Record<string, unknown> = {}; if (windowLabel) params.window = windowLabel; const result = await this.sendCommand('probe_bridge', params) as { windows: Record<string, { initialized: boolean; bridge_alive: boolean }>; }; return result.windows; }