snapshot
Get the accessibility tree from a Tauri window, returning reference numbers to enable click and fill interactions with UI elements.
Instructions
Get accessibility tree (returns ref numbers for click/fill)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| window | No | Window label (default: focused window) |
Implementation Reference
- Schema definition for the 'snapshot' tool, describing its purpose ('Get accessibility tree') and optional 'window' input parameter.
snapshot: { name: 'snapshot', description: 'Get accessibility tree (returns ref numbers for click/fill)', inputSchema: z.object({ window: z.string().optional().describe('Window label (default: focused window)'), }), }, - Handler function for the 'snapshot' tool. Calls socketManager.snapshot(args) and returns the formatted result as text content.
snapshot: async (args: { window?: string }) => { const result = await socketManager.snapshot(args); return { content: [ { type: 'text' as const, text: result, }, ], }; }, - SocketManager.snapshot() helper method that sends a 'snapshot' JSON-RPC command to the Tauri backend and formats the result.
async snapshot(options?: { window?: string }): Promise<string> { const params: Record<string, unknown> = {}; if (options?.window) params.window = options.window; const result = await this.sendCommand('snapshot', params) as { window: string; snapshot: string; title: string; url: string }; // Format as readable output with window label return `# [${result.window}] ${result.title}\nURL: ${result.url}\n\n${result.snapshot}`; } - packages/tauri-mcp/src/server.ts:14-23 (registration)Registration of 'snapshot' in the DEFAULT_ESSENTIAL_TOOLS list, ensuring it's included by default in the MCP server tool listing.
const DEFAULT_ESSENTIAL_TOOLS = [ 'get_session_status', 'start_session', 'stop_session', 'snapshot', 'click', 'fill', 'screenshot', 'navigate', ];