Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Tools Reference

Victauri exposes 35 MCP tools organized into standalone tools (one action per call) and compound tools (multiple actions via an action parameter).

All tools are accessible via MCP at /mcp, REST at POST /api/tools/{tool_name}, or the shell: victauri call <tool> key=value key:=<json> prints the result as JSON (victauri tools <tool> shows a tool’s arguments; see the CLI README).

Common parameters. Every tool that touches a webview accepts webview_label (aliases window, window_label) to pick the window; without it the default window is used (main, else the first visible one). Every compound tool takes a required action string naming the operation.

Backend Tools

These tools access the Rust backend directly — no webview proxy, no JavaScript evaluation.

app_info

Get application configuration, directory paths, environment, discovered databases, and process info.

Parameters: None required.

Returns: {config, paths, databases, process, env}


list_app_dir

Browse files in app backend directories (data, config, log, local_data).

Parameters:

NameTypeRequiredDescription
directorystringnoOne of: data, config, log, local_data (default: data)
pathstringnoSubdirectory to list within the chosen directory
patternstringnoGlob to filter entries (e.g. *.db): * any run of characters, ? one character, anything else ([ and ] included) itself
max_depthnumbernoRecursion depth (default: 1)

Returns: {base, path, exists, count, truncated, entries: [{name, path, is_dir, size, modified}]}

A listing stops (and reports truncated) at 10,000 returned entries, 100,000 examined entries, or 5 s — whichever comes first — so a pattern that matches nothing in a huge tree still returns.


read_app_file

Read a file from one of the app’s backend directories.

Parameters:

NameTypeRequiredDescription
pathstringyesFile path relative to the directory root
directorystringnoOne of: data, config, log, local_data (default: data)
max_bytesnumbernoMax bytes to read (default: 1 MB)
binarybooleannoReturn base64 instead of UTF-8 text

Returns: UTF-8 text, or base64-encoded bytes when binary is true. Path-traversal-guarded. A read truncated at max_bytes in the middle of a multi-byte character drops the partial character and stays UTF-8 text.


query_db

Execute a read-only SQL query against a SQLite database in the app’s data directory.

Parameters:

NameTypeRequiredDescription
querystringyesSQL query — SELECT/PRAGMA(read)/EXPLAIN/WITH only
pathstringnoPath to the database file (auto-discovers if omitted)
paramsarraynoPositional bind parameters
max_rowsnumbernoMax rows to return (default 100)

Examples:

{"query": "SELECT * FROM users WHERE active = ?", "params": [true]}
{"query": "SELECT count(*) FROM items", "path": "app.db"}

Returns: {columns, rows, row_count, truncated, max_rows}

Limits: a 5 MB result budget charged cell by cell (the result is truncated rather than built past it), at most 256 result columns, 1 MB per value, LIKE/GLOB patterns up to 1000 bytes, a 5 s CPU deadline, a 1 s wait for a lock held by the app, and at most two database calls (query_db / db_health) running at once — a third gets a “busy” error. Duplicate result column names get :N keys (a, a:1) so no value is lost; columns lists exactly the keys each row carries. A single string function (LIKE, replace, instr) is one uninterruptible SQLite step, so a pathological call can overrun the deadline by seconds on its worker thread; the tool call itself returns at the deadline.

Read-only and path-traversal-guarded: writes (INSERT/UPDATE/…), stacked queries, ATTACH, and the write form of PRAGMA (PRAGMA x = y) are rejected. By default only the OS app-data directories are searched; if your app stores its DB elsewhere (a project/working dir or custom path), register the directory via VictauriBuilder::db_search_paths(["../data", "/abs/path"]) — then relative names and absolute paths within those roots become reachable.


Webview & IPC Tools

eval_js

Evaluate JavaScript in the webview and return the result.

Parameters:

NameTypeRequiredDescription
codestringyesJavaScript code to evaluate (expressions, statements, or async/await)
webview_labelstringnoTarget webview (defaults to “main” or first visible)

Examples:

{"code": "document.title"}
{"code": "document.querySelectorAll('button').length"}
{"code": "await fetch('/api/data').then(r => r.json())"}

Auto-return: a single bare expression is auto-wrapped with return (document.title → return document.title). Multi-statement code must include an explicit return — e.g. localStorage.setItem('k','v'); return localStorage.getItem('k') — or be wrapped in an IIFE. Without one every statement still runs, but the result is undefined. async/await is supported.

JavaScript errors (thrown exceptions) return an MCP error with isError: true. undefined returns "undefined", null returns null. A syntax error is reported at once as a JavaScript parse error (“the code did not begin executing”) — code reported that way never runs later. A result JSON cannot represent (a circular object, a BigInt, a function) is reported as “the code ran, but its result could not be serialized”, never as a JavaScript error. A page reload under the call fails it promptly. Targeting a hidden or unresponsive window fails fast (~2s); and if a prior eval timed out, the next call re-probes and fails fast if the webview reloaded or the app stopped responding.


dom_snapshot

Capture a full accessible DOM tree with ref handles for every element.

Parameters:

NameTypeRequiredDescription
webview_labelstringnoTarget webview
formatstringnocompact (default, accessible text, ~70-80% fewer tokens) or json (full tree)

Returns: Tree of elements with ref, role, name, children, and bounding box data. Descends into open shadow DOM and same-origin iframes (cross-origin frames are marked and skipped).


find_elements

Search for elements by CSS selector or text content. Returns an MCP error for invalid CSS selectors. Searches into open shadow roots and same-origin iframes — frame elements get ref handles and are fully interactable.

Parameters:

NameTypeRequiredDescription
selectorstringnoCSS selector (alias: css). Invalid selectors return an error.
textstringnoText content to search for
rolestringnoARIA role to filter by
webview_labelstringnoTarget webview
test_idstringnoExact data-testid value
namestringnoAccessible name (aria-label, title, placeholder; case-insensitive substring)
tagstringnoTag name, e.g. button
placeholderstringnoPlaceholder text (case-insensitive substring)
altstringnoAlt text (case-insensitive substring)
title_attrstringnotitle attribute (case-insensitive substring)
labelstringnoAssociated <label> text (finds inputs by their label)
exactbooleannoExact instead of substring text matching
enabledbooleannoFilter by enabled state
max_resultsintegernoMaximum results (default 10)

Examples:

{"selector": "button.primary"}
{"text": "Submit"}
{"role": "heading"}

invoke_command

Invoke a Tauri command from the backend.

Parameters:

NameTypeRequiredDescription
commandstringyesCommand name
argsobjectnoArguments to pass
timeout_msintegernoTime budget for the whole call — sending the command and waiting for its result (default: the plugin eval timeout, 30 s; max 300000). Raise it for legitimately slow commands. victauri-test: invoke_command_with_timeout
with_logsbooleannoThe result becomes {"result": …, "backend_logs": […]}: every backend log entry (debug and above) captured while the command ran, including concurrent background activity in that window. Needs backend capture

Example:

{"command": "get_settings", "args": {}}
{"command": "search_context", "args": {"query": "hello"}}

screenshot

Capture a PNG screenshot of the application window.

Parameters:

NameTypeRequiredDescription
window_labelstringnoTarget window (defaults to main)

Returns: Base64-encoded PNG image data, and a text block naming the window captured (note: captured window "main"; over REST, a note beside the image), since with no label screenshot picks the window itself.

Linux: capture requires X11 or XWayland (the common case, including CI under xvfb). A pure-Wayland session exposes no safe per-window capture path, so screenshot returns a clear error there rather than a wrong or blank image. Windows and macOS capture natively.


verify_state

Compare frontend and backend state to detect drift.

Parameters:

NameTypeRequiredDescription
frontend_exprstringnoJS expression for frontend state
backend_stateobjectnoExpected backend state to compare
backend_commandstringnoTauri command whose result is the backend state (instead of backend_state)
backend_argsobjectnoArguments for backend_command

Example:

{
  "frontend_expr": "({title: document.title})",
  "backend_state": {"title": "My App"}
}

The expression must produce the same shape as the backend state: document.title on its own is a string, which diverges from {"title": "My App"} at $ even when the title is right.


detect_ghost_commands

Classify every command the frontend invoked by its observed outcome: a command that succeeded at least once provably has a handler (counted in verified_handlers); one that only ever failed with “not found” is listed in confirmed_ghosts; plugin:* built-ins are excluded_builtins; frontend_only is the weak tier (absent from the #[inspectable] registry, which is a subset of the real handler set). Read reliability and note before treating frontend_only as a bug list.

Parameters:

NameTypeRequiredDescription
since_msintegernoOnly consider commands invoked within the last N ms (scopes detection to the current test without clearing the IPC log)

Returns: confirmed_ghosts (each {name, error}), verified_handlers (a count), frontend_only, excluded_builtins, registry_only, total_frontend_commands, total_registry_commands, reliability (none/low/high) and note.


check_ipc_integrity

Verify the health of IPC communication.

Parameters:

NameTypeRequiredDescription
stale_threshold_msintegernoAge after which a pending IPC call counts as stale (default 5000)

Returns: {healthy, total_calls, pending_count, stale_count, error_count, stale_calls, errored_calls, warning}


wait_for

Wait for a condition to become true, polling until timeout. Use the expression and event conditions to await async backend work to true completion instead of guessing with a fixed sleep.

Parameters:

NameTypeRequiredDescription
conditionstringyesOne of: selector, selector_gone, text, text_gone, url, ipc_idle, network_idle, expression, event, log. text, text_gone and selector_gone are not met while the page has no body (mid navigation). An invalid selector is a tool error. ipc_idle returns ok: false at once, with ipc_capture: "none", when the IPC log is blind to the page’s traffic
valuestringnoSelector/text/URL to match; the JS expression (expression); the Tauri event name (event); or the text a backend log line must contain (log). Not needed for ipc_idle/network_idle
expectedanynoFor expression: the JSON value the expression must equal. Omit to wait for the expression to become truthy
since_msnumbernoFor event and log: how far back (ms) to accept an already-fired event or line when the wait begins (default: 2000)
levelstringnoFor log: minimum level (trace/debug/info/warn/error)
fieldsobjectnoFor log: the line’s structured fields must also equal these (text compare, case-insensitive)
since_seqnumbernoFor log: only lines with sequence number ≥ this (overrides since_ms) — take it from invoke_command {with_logs:true}’s backend_log_cursor before the work starts
timeout_msnumbernoMax wait time in ms (default: 10000)
poll_msnumbernoPoll interval in ms (default: 200)

Conditions for async completion:

  • expression — polls a JS expression until truthy (or == expected). It may await, so you can await a fire-and-forget command’s status directly. Level-triggered and race-free; needs no app changes. Returns { ok, value, elapsed_ms }.
  • event — blocks until a named Tauri event fires (evaluated against the captured event bus, with a since_ms look-back). The app must emit the event and Victauri must capture it via VictauriBuilder::listen_events. Returns { ok, event, elapsed_ms }.
  • log — blocks until the Rust backend logs a line containing value (case-insensitive, over message, target, fields and spans), at or above level. Edge-triggered: the waiter wakes the moment the line is captured. Needs backend log capture — see Backend Logs.

Example:

{"condition": "selector", "value": ".modal.open", "timeout_ms": 3000}
{"condition": "url", "value": "/dashboard"}
{"condition": "expression", "value": "(await window.__TAURI_INTERNALS__.invoke('get_status')).running === false", "timeout_ms": 30000}
{"condition": "event", "value": "analysis-complete", "timeout_ms": 30000}
{"condition": "log", "value": "pipeline complete", "level": "info", "timeout_ms": 30000}

The robust async pattern is invoke_command(...) then wait_for(expression|event|log, ...).


app_state

Read application-defined backend state through a registered probe. Probes give an agent first-class, discoverable access to domain state (a scoring pipeline’s version and stale-item count, a queue’s depth, cache stats) that would otherwise require query_db + log-grepping. A probe runs in the Rust process with no IPC round-trip and no frontend involvement — direct-backend introspection a browser-external tool cannot do.

Apps register probes via VictauriBuilder::probe("name", || serde_json::json!({ … })) (build your shared state as an Arc once, clone it into both .manage() and the probe).

Parameters:

NameTypeRequiredDescription
probestringnoName of the probe to run. Omit to list all available probe names

Example:

{}                       // → { "probes": ["scoring", "queue"] }
{"probe": "scoring"}     // → { "pipeline_version": 5, "stale_items": 0 }

assert_semantic

Assert a condition about the application state using JS expressions.

Parameters:

NameTypeRequiredDescription
expressionstringyesJS expression to evaluate
conditionstringyesOne of: equals, not_equals, contains, greater_than, less_than, truthy, falsy
expectedanynoExpected value (not needed for truthy/falsy)
labelstringnoHuman-readable name for the assertion (default empty)

Example:

{
  "expression": "document.title",
  "condition": "equals",
  "expected": "My App"
}

resolve_command

Resolve a natural language description to registered commands.

Parameters:

NameTypeRequiredDescription
querystringyesNatural language description
limitintegernoMaximum results (default 5)

Example:

{"query": "show settings"}

get_registry

List all registered commands with their metadata.

Parameters:

NameTypeRequiredDescription
querystringnoFilter commands by name or description

Each argument lists its Rust name, and — when it differs — the key the frontend invokes it by: Tauri camelCases argument names by default (size_kb → sizeKb), so pass key (or name when there is no key) in invoke_command’s args.


get_memory_stats

Get real OS process memory usage.

Parameters: None.

Returns: {working_set_bytes, peak_working_set_bytes, page_fault_count, page_file_bytes}


get_plugin_info

Get plugin version, uptime, configuration, and capabilities.

Parameters: None.


get_diagnostics

Environment diagnostics for a webview: service workers, closed shadow DOM, iframes, DOM size, CSP, and IPC capture completeness.

Parameters: webview_label (optional).

info.ipc_capture says which Tauri IPC transport the page uses and how much of it Victauri sees:

FieldValues
transportfetch (custom protocol, desktop default) · post_message_fallback (Tauri switched after a custom-protocol failure) · post_message (always postMessage, e.g. Android) · unknown (no IPC yet)
capturefull · requests_only (responses unobservable; calls logged with status unknown) · none (switch detected, traffic invisible) · unknown
post_message_hookinstalled · replaced (page code swapped JSON.stringify; postMessage capture is then none) · missing
fetch_calls, post_message_calls, post_message_responsescounters for this page
fallback_detected_via, fallback_atconsole_warning / custom_protocol_blocked, and when
noteplain-language explanation

When Tauri has switched to postMessage, warnings includes ipc-postmessage-fallback. The same object is attached as ipc_capture to detect_ghost_commands, check_ipc_integrity, and introspect coverage / command_catalog / command_timings.

postMessage-captured calls are unproven (Tauri’s callback functions are page-callable, so page script can stage one): ghost detection keeps them in a separate post_message_only tier and command_catalog prefers fetch-transport shapes (shapes_from_post_message). coverage and command_timings do count them — on Android every call travels over postMessage. An IPC entry whose callback ids two different commands claimed is flagged ids_contested with contested_commands.


Compound Tools

Compound tools use an action parameter to select the specific operation.

interact

Element interactions with Playwright-grade actionability checks. Works on elements inside same-origin iframes too (refs from a snapshot/find resolve across frame boundaries).

An action the page refuses — element covered, disabled, hidden, detached, not a <select>, or ref not found — is a tool error (MCP isError: true; REST {"error": …}) whose text is the reason followed by [hint: RETRY_LATER] (the UI may still settle) or [hint: CHECK_INPUT] (wrong target). The same applies to input, inspect (e.g. get_styles on an unknown ref) and route add. (Before 0.9.0 these came back as a successful {"ok": false, "error": …} result.)

ActionParametersDescription
clickref_idClick an element
double_clickref_idDouble-click an element
hoverref_idHover over an element
focusref_idFocus an element
scroll_into_viewref_idScroll element into viewport
select_optionref_id, value or valuesSelect option(s) in a <select>; values: [] clears a <select multiple>

Options:

NameTypeRequiredDescription
trustedbooleannoclick: deliver a real OS mouse click (isTrusted: true) at a point of the element that a click reaches, usually its centre. Refused if the point is outside the window’s client area or cannot be worked out (a scaled, rotated or zoomed frame, a pinch-zoomed page). Windows only; the app window must be in the foreground
xnumbernoscroll_into_view without ref_id: horizontal scroll position in px
ynumbernoscroll_into_view without ref_id: vertical scroll position in px

Trusted (OS-level) clicks: add "trusted": true to click to deliver a real OS mouse event (isTrusted: true) at the element’s center, instead of a synthetic DOM event — for app handlers that gate on event.isTrusted or browser features needing user activation. Implemented on Windows (Win32 SendInput); on macOS/Linux it returns a clear “not implemented” error so you fall back to the default synthetic click. The window is brought to the foreground first. An OS click lands wherever the point is on screen, so it is refused, naming the synthetic click, when the point cannot be worked out: inside a frame that is scaled, rotated or zoomed (on the frame or an ancestor of it; a pure translation is fine), or on a pinch-zoomed page.

Example:

{"action": "click", "ref_id": "k3f9e3"}
{"action": "click", "ref_id": "k3f9e3", "trusted": true}
{"action": "select_option", "ref_id": "k3f9e9", "value": "us"}

input

Text input and keyboard operations.

ActionParametersDescription
fillref_id, valueSet input value directly
type_textref_id, textType character-by-character
press_keykeyPress a keyboard key

Options:

NameTypeRequiredDescription
trustedbooleannotype_text/press_key: deliver real OS keyboard input (isTrusted: true). The element is focused first and the call is refused if focus does not land on it. Windows only; the app window must be in the foreground

Trusted (OS-level) input: add "trusted": true to type_text or press_key to deliver real OS keystrokes (isTrusted: true) into the focused element instead of synthetic DOM events. The target element (ref_id) is focused first. Implemented on Windows (Win32 SendInput); macOS/Linux fall back to synthetic input with a clear error.

Example:

{"action": "fill", "ref_id": "k3f9e5", "value": "hello@example.com"}
{"action": "type_text", "ref_id": "k3f9e5", "text": "Hello"}
{"action": "type_text", "ref_id": "k3f9e5", "text": "Hello", "trusted": true}
{"action": "press_key", "key": "Enter"}

Supported keys: Tab, Escape, Enter, ArrowUp, ArrowDown, ArrowLeft, ArrowRight, F1-F12, and any single character.


window

Window management operations.

ActionParametersDescription
get_statelabelGet window state (position, size, visibility)
list—List all window labels
managelabel, manage_actionminimize, unminimize, maximize, unmaximize, close, focus, show, hide, fullscreen, unfullscreen, always_on_top, not_always_on_top
resizelabel, width, heightResize a window. Reports the size read back (physical pixels) next to requested; settled: false if the window did not change within about 500 ms (Linux and macOS apply it asynchronously, and a window manager may ignore it)
move_tolabel, x, yMove a window. Reports the position read back, with settled: false likewise
set_titlelabel, titleChange window title
introspectability—Probe every window’s JS bridge and report which are introspectable vs. blind

introspectability answers “which windows can Victauri actually see?” A window that returns introspectable: false while visible: true is almost always missing the victauri:default capability — Tauri’s per-window permission ACL silently blocks the bridge’s callback IPC, so eval_js/dom_snapshot/animation/find_elements see nothing with no error. The diagnostic names the exact capability file to edit. Required per window (not just main).

Example:

{"action": "list"}
{"action": "get_state", "label": "main"}
{"action": "resize", "label": "main", "width": 1200, "height": 800}
{"action": "introspectability"}

storage

Browser storage operations.

ActionParametersDescription
getkey, storage_typeGet a value (storage_type: local (default) or session)
setkey, value, storage_typeSet a value
deletekey, storage_typeDelete a key
get_cookies—Get the page’s cookies (non-httpOnly only — read via document.cookie)

Example:

{"action": "set", "key": "theme", "value": "dark"}
{"action": "get", "key": "theme"}

Navigation and history operations.

ActionParametersDescription
go_tourlNavigate to a URL (http/https only)
go_back—Go back in history. On a page that stopped answering (a page without the bridge, or one stuck in a loop) it navigates natively to the last URL inside the app, reports recovered only once the page answers there, and errors if it does not. WebView2 and WebKitGTK get off a page spinning in a loop: on Linux by ending the one web process whose main thread spun throughout, if every other window that has answered still answers with it paused. That takes about 15 s, the result says ended_web_process: <pid>, and a page that was only slow loses its work. On macOS the navigation waits for the script to end
get_history—Get navigation history log
set_dialog_responsedialog_type, dialog_action, textAuto-respond to future alert/confirm/prompt dialogs (accept / dismiss)
get_dialog_log—Get dialog log (alerts, confirms, prompts)

Example:

{"action": "go_to", "url": "https://example.com"}
{"action": "get_history"}
{"action": "set_dialog_response", "dialog_type": "confirm", "dialog_action": "accept"}

recording

Time-travel recording for session capture and replay.

ActionParametersDescription
startsession_id (optional)Start recording events
stop—Stop recording and return session
checkpointcheckpoint_id (optional, auto-generated), checkpoint_label (alias: label), stateCreate a checkpoint
list_checkpoints—List checkpoints
get_eventssince_indexGet recorded events
events_betweenfrom, to (checkpoint ids)Events between two checkpoints
get_replay—The recorded IPC call sequence
export—Export full session data (works after stop)
importsession_jsonImport a session (becomes the active recording; refused while one is in progress)
replaywebview_labelRe-invoke recorded IPC commands (see below; works after stop)
flushwebview_labelPull pending bridge events into the active recording now

replay semantics. Recordings do not capture call arguments, so replay re-invokes only calls that succeeded with no arguments. Calls that had arguments, failed, or never completed are reported as skipped with a reason; commands blocked by the privacy allow/blocklist are reported as blocked. passed means the re-invocation succeeded — the response is not diffed against the original (only its JSON type is reported). Re-invoked commands run for real, so their side effects happen again.

Each call is re-invoked in the window that recorded it — a window’s Tauri capabilities are its own — and is skipped if that window no longer exists (it never falls back to main); webview_label only filters which recorded calls are replayed. Calls that were fulfilled or blocked by a network route (route add, which page script can also use) are recorded as mocked and never replayed: they never reached the backend. (Script in the recording window can still rewrite what the recording captures from that window — see Security.)

Example:

{"action": "start"}
{"action": "checkpoint", "label": "after-login"}
{"action": "get_events", "since_index": 0}
{"action": "stop"}
{"action": "replay"}

inspect

CSS inspection, accessibility, and performance profiling.

ActionParametersDescription
get_stylesref_id, propertiesGet computed CSS styles
get_bounding_boxesref_idsGet bounding boxes with box model
highlightref_id, color, highlight_labelDraw debug overlay on element
clear_highlights—Remove all debug overlays
audit_accessibility—Run WCAG accessibility audit
get_performance—Get performance metrics

Options:

NameTypeRequiredDescription
highlight_labelstringnohighlight: text shown above the overlay

Example:

{"action": "get_styles", "ref_id": "k3f9e3", "properties": ["color", "font-size"]}
{"action": "get_bounding_boxes", "ref_ids": ["k3f9e1", "k3f9e2", "k3f9e3"]}
{"action": "audit_accessibility"}
{"action": "get_performance"}

The accessibility audit checks: missing alt text, unlabeled form inputs, empty buttons/links, heading hierarchy, color contrast (WCAG AA), ARIA role validity, positive tabindex, and missing document language/title.

Performance metrics include: navigation timing, resource summary, paint timing (FP/FCP), JS heap usage, long task count, and DOM statistics.


css

CSS injection for debugging and prototyping.

ActionParametersDescription
injectcssInject custom CSS (replaces previous)
remove—Remove injected CSS

Options:

NameTypeRequiredDescription
allow_remotebooleannoAllow @import and remote url(...) in injected CSS (default false: blocked, because remote references turn css inject into an exfiltration channel)

Example:

{"action": "inject", "css": "* { outline: 1px solid red; }"}
{"action": "remove"}

logs

Access all captured logs from the application.

ActionParametersDescription
consolesince, limitConsole log entries
networkfilter, limit, bodiesNetwork request log
ipclimit, bodies, wait_for_captureIPC command log (calls captured on Tauri’s postMessage fallback carry transport: "post_message"; args_truncated: true when args is not what was sent: cut, over the capture cap, or not captured)
navigationlimitNavigation history
dialogslimitDialog interactions
eventssince, limitEvent stream
slow_ipcthreshold_msIPC calls slower than threshold
clear—Clear the IPC + network logs (per-test isolation)
backendlevel, target, filter, fields, since_seq, limitThe Rust backend’s own log: structured entries (typed fields, span context, thread, file:line) plus captured panics. Without since_seq the newest limit entries; with it the oldest after the cursor, and next_seq continues after them (read on while truncated)
backend_digestlimit (top N per list, default 10)Start here: counts per level, noisiest targets, repeated messages collapsed into templates, recent warnings/errors, every panic
stdoutlevel, filter, since_seq, limitRaw stdout/stderr when the app was launched via victauri run, including how the process exited. since_seq pages forward like backend; next_seq is opaque (it also says which file of a rotated capture it is for), and gap: true says the capture rotated past it

Options:

NameTypeRequiredDescription
filterstringnonetwork: URL substring filter; backend/stdout: case-insensitive text match
limitintegernoMost entries to return, keeping the newest; 0 returns none. Default 100 (slow_ipc: 20)
bodiesbooleannoipc/network: false leaves out args and request/response bodies, so reading up to 1000 entries stays small (default true)
wait_for_capturebooleannoipc: wait up to 500 ms for the newest entry’s response body to be captured

Example:

{"action": "console", "level": "error"}
{"action": "network"}
{"action": "slow_ipc", "threshold_ms": 100}
{"action": "backend_digest"}
{"action": "backend", "level": "warn", "target": "my_app::db", "filter": "timeout"}

The backend* and stdout actions need a capture source — see Backend Logs.

console/network/ipc/navigation/dialogs/events return the newest 100 entries by default (slow_ipc: 20) as a bare array, with nothing to say more exist; large per-entry fields are cut at 4 KB. Pass an explicit limit for more.


route

Network request interception — the Playwright route() equivalent, implemented purely in the JS bridge (no CDP; the same behaviour on all three Tauri webviews, within the fetch/XHR limits below). Matches webview fetch/XHR by URL and blocks, mocks, or delays them. Rules are page-scoped (cleared on reload).

ActionParametersDescription
addpattern, behavior, …Add a rule (see below)
list—List active rules
clearidRemove a rule by id
clear_all—Remove all rules
matcheslimitLog of intercepted requests

add parameters:

NameTypeRequiredDescription
patternstringyesURL pattern to match. Tested against the request’s absolute URL (resolved against the page’s base URL), its path + query + fragment when same-origin, and the URL string as the app passed it — so a rule hits the same request whether the app calls fetch('/api/x'), fetch(new URL(…)) or fetch(new Request(…)), and likewise for XHR
match_typestringnosubstring (default), glob (* matches any run of characters; every other character, including ?, is literal), regex, exact
methodstringnoRestrict to one HTTP method
behaviorstringnoblock (abort), fulfill (mock — default), delay
statusnumbernoMock response status (fulfill, default 200; ignored by Tauri’s invoke on an IPC URL)
status_textstringnoMock response status text (fulfill)
headersobjectnoMock response headers (fulfill; an IPC mock needs "Tauri-Response": "ok" to resolve invoke)
bodyanynoMock response body (fulfill)
content_typestringnoMock content-type (fulfill, default application/json)
delay_msnumbernoLatency to inject (delay; also delays a fulfill)
timesnumbernoMax times the rule fires (0 = unlimited)

Example:

{"action": "add", "pattern": "/api/users", "behavior": "fulfill", "status": 200, "body": {"users": []}}
{"action": "add", "pattern": "analytics", "behavior": "block"}
{"action": "add", "pattern": "*/slow", "match_type": "glob", "behavior": "delay", "delay_ms": 2000}
{"action": "matches"}

Scope: fetch and XHR support all behaviors: a fulfilled XHR never reaches the network, and reports the rule’s status, headers and body through its responseType, with its usual events. Top-level navigation, sub-resources (img/css), and WebSocket frames are not intercepted.

A regex that can hang the page is refused at add. JavaScript has no regex timeout, and a rule’s regex runs on the page’s main thread against every request URL. A repeated group that can take the same text in more than one way is refused, also when the ambiguity sits in a subgroup: (a+)+, (a*)*, (a|aa)+, (.*)*, (x(a|a)y)+. ^/api/(users|items)/\d+$, .*\.png$, (/\w+)+, (api|app)+ and ([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$ are fine. The check is on the repetition only: slow patterns with no repeated group (.*.*.*.*x) still get through. It errs towards refusing: a counted group is treated as unbounded and \b as always passing, so (a+){2} and (\w+\b)+ are refused, as is a repeated group that can match nothing, such as (a|)+.

Rules on Tauri IPC change what the app’s real invoke gets. On the fetch transport (http://ipc.localhost/<cmd> on Windows — https://ipc.localhost/<cmd> with useHttpsScheme — ipc://localhost/<cmd> on macOS/Linux — the desktop default until a fallback), Tauri’s invoke goes through the page’s fetch, so a matching rule takes effect (verified live on Windows, Tauri 2.11.5):

  • fulfill mocks the command. The Rust handler never runs. invoke resolves with the body only when headers include "Tauri-Response": "ok"; otherwise it rejects with the body — which is how to make a command fail for a user clicking the UI. Tauri reads the body by content_type, and a mock it could not read (no body, a non-JSON body or a 204 under application/json) would make it run the REAL command over postMessage. So add refuses such a rule when its pattern names the IPC host, and refuses any mock the Response constructor rejects (an invalid header, a non-ByteString status_text). A broader pattern (greet, */greet) is accepted with an ipc_warning; a matching IPC call then gets a Tauri error from Victauri (logged mock_unreadable) — the real command never runs.
  • delay holds the call back before it reaches the backend.
  • block does NOT fail the call. The blocked fetch rejects, which Tauri treats as a broken custom protocol: it retries that call over window.ipc.postMessage (the backend still runs it) and uses postMessage for the rest of the page’s life (until a reload). Victauri still captures those calls (transport: "post_message") and get_diagnostics reports the switch.

The IPC log tags calls a rule touched: mocked: true (and route_rule) when a rule answered it, route_delay_ms when one held it back. Mocked calls never reached the backend, so ghost detection, command_catalog and coverage leave them out; command_timings also leaves out delayed calls. A mocked call’s status follows Tauri-Response, as the app’s invoke does (the HTTP status is ignored). add returns an ipc_note whenever a rule can match an IPC URL (a broad pattern such as * or localhost does too). postMessage IPC (always on Android; on desktop after a fallback) is not affected by rules. The fault tool is separate: it acts on commands you drive through invoke_command.


trace

Screencast / visual timeline — captures the window at a fixed interval into a ring buffer via the native screenshot path (no CDP). Pairs with recording (events) and logs (network/console) to form a Playwright-trace-style bundle.

ActionParametersDescription
startinterval_ms, max_frames, with_eventsBegin capturing
stop—Stop and return a summary
status—Active flag + buffered frame count
frameslimitReturn captured frames as base64 PNGs

start defaults: interval_ms 500 (min 50, max 60000), max_frames 60 (max 600). Set with_events: true to also start the event recorder so the trace bundles the IPC/DOM/console timeline alongside the screencast.

Limits and lifecycle:

  • A trace auto-stops after 30 minutes (an abandoned trace must not capture forever).
  • The frame buffer is a ring (max_frames) and is also capped at 256 MB total; the oldest frames are dropped first.
  • frames returns the newest frames that fit a 25 MB response cap (with a note when it had to drop older ones) — pass a smaller limit to page.
  • Hidden windows are skipped: a frame is only captured while the target window is visible (a native capture of a hidden window would return stale or another window’s pixels), so a hidden period shows up as a gap, not a wrong image.
  • stop (or the 30-minute auto-stop) also ends the recording that with_events started; a recording you started separately with recording start is left alone. The stopped session stays readable via recording get_events / export.
  • Frames come from the native screenshot path, so the platform limits of screenshot apply (Linux needs X11/XWayland).

Example:

{"action": "start", "interval_ms": 250, "max_frames": 40, "with_events": true}
{"action": "status"}
{"action": "stop"}
{"action": "frames", "limit": 10}

Backend Introspection (Victauri-Exclusive)

These tools exploit Victauri’s position inside the Rust process to provide insights and control that browser-external tools like CDP cannot access.

introspect

Deep backend introspection — command performance profiling, IPC contract testing, coverage analysis, startup timing, capability auditing, process enumeration, and event bus monitoring.

ActionParametersDescription
command_timingsslow_threshold_msPer-command execution timing stats (min/max/avg/p95)
coverage—Which registered commands have been called this session
command_catalog—Per-command argument + result shapes mined from the live IPC log, merged with the registry — real call/return schemas even when the app doesn’t use #[inspectable] (where get_registry is names-only)
contract_recordcommand, argsRecord a command’s response shape as baseline
contract_check—Check all recorded contracts for schema drift
contract_list—List all recorded contract baselines
contract_clear—Clear all recorded contract baselines
startup_timing—Victauri plugin initialization phase-by-phase timing breakdown
capabilities—Tauri v2 capabilities, security config (CSP, freeze_prototype), plugins, and window definitions
db_healthdb_pathBounded, read-only SQLite diagnostics (see below)
plugin_state—Victauri plugin internal state: event counts, registry, recording, faults, timings, uptime
processes—Host process + child processes (sidecars, background workers) with PID, name, and memory
plugin_tasks—Victauri’s spawned async tasks (MCP server, event drain) with active/finished counts
event_bus—All captured Tauri events (automatically intercepted) + app events from EventLog
event_bus_clear—Clear both event bus and event log

db_health report. Opens the database read-only and returns: journal_mode, page_count, page_size, db_size_mb, freelist_count; the table list with per-table row_count (counted under a 5 s budget — tables not reached get row_count: null and row_counts_complete: false; the listing is capped and flagged by tables_truncated); and integrity_check from SQLite PRAGMA quick_check under its own 5 s budget. When the file may contain virtual tables and the host app has registered a non-built-in virtual-table module, the check runs table by table over ordinary tables only (integrity_check_kind: "quick_check (per table)", reason in integrity_check_note), so no app-registered module code runs; otherwise integrity_check_note is null. On a large database quick_check may report "not completed: … exceeded its budget …" — that means unknown, not corrupt. It never checkpoints or inspects the -wal file (wal_checkpoint is reported as “not run (read-only diagnostics)” in WAL mode).

Examples:

{"action": "command_timings", "slow_threshold_ms": 100}
{"action": "coverage"}
{"action": "command_catalog"}
{"action": "contract_record", "command": "get_settings"}
{"action": "contract_check"}
{"action": "startup_timing"}
{"action": "capabilities"}
{"action": "db_health"}
{"action": "plugin_state"}
{"action": "processes"}
{"action": "plugin_tasks"}
{"action": "event_bus"}

fault

Probe a backend command handler under failure for chaos engineering.

Scope: faults apply only to commands you run via the invoke_command tool — they do not touch the app’s real user-driven IPC (window.__TAURI_INTERNALS__.invoke). Use fault to test a handler’s error path when you drive it (e.g. “does my error branch return the right shape on a DB failure?”). To make a call the user’s click triggers fail or slow down, use a route rule on its IPC URL (fulfill without a Tauri-Response: ok header, or delay) — that works on Tauri’s fetch transport only.

ActionParametersDescription
injectcommand, fault_type, delay_ms, error_message, max_triggersAdd a fault rule
list—List all active fault injection rules
clearcommandRemove a specific fault rule
clear_all—Remove all fault rules

Fault types:

  • delay — sleep delay_ms (max 120 000), then run the command normally.
  • error — return [FAULT INJECTED] command '<name>': <error_message> without running the command.
  • drop — return {} without running the command.
  • corrupt — run the command for real (side effects happen), then return a fixed marker instead of its result: {"__corrupted":true,"original_length":<n>,"fault":"corrupt"}.

Rules auto-expire 15 minutes after they are injected (so a forgotten fault cannot sabotage a later run — re-inject to refresh) or after max_triggers hits (0 = unlimited).

Examples:

{"action": "inject", "command": "get_settings", "fault_type": "delay", "delay_ms": 2000}
{"action": "inject", "command": "save_data", "fault_type": "error", "error_message": "disk full"}
{"action": "inject", "command": "fetch_feed", "fault_type": "drop", "max_triggers": 3}
{"action": "list"}
{"action": "clear_all"}

explain

Natural-language narration of what happened in the app. Aggregates recent events over a time window and produces human-readable summaries, causal chains, or diffs.

Event source. While a recording is active, explain reads the recorder-fed event log. When nothing is recording, it reads the JS bridge’s own event stream on demand (IPC, DOM mutations, console, network, navigation) for the requested window — without storing it, so a later recording never double-counts. Victauri’s own internal traffic is filtered out. Network requests are counted as state changes and navigations as window events in the tallies.

ActionParametersDescription
summarysecondsAggregate events over N seconds (default: 30) into a narrative with type counts
last_actionsecondsMap recent events to a causal chain with “ → “ separators (default: 5s)
diffsecondsCount IPC calls, DOM changes, errors, and interactions over N seconds (default: 10)

Parameters:

NameTypeRequiredDescription
actionstringyesOne of: summary, last_action, diff
secondsintegernoHow many seconds to look back
webview_labelstringnoTarget webview window

Examples:

{"action": "summary"}
{"action": "summary", "seconds": 60}
{"action": "last_action"}
{"action": "diff", "seconds": 15}

animation

Quantitative, deterministic, cross-platform access to the webview’s animation engine via the Web Animations API. Works identically on WebView2 / WKWebView / WebKitGTK with no CDP. Closes the last blind spot in agent perception — screenshots are frozen instants; this lets an agent perceive time-based behaviour.

ActionParametersDescription
listwebview_labelgetAnimations() introspection: declared timing (duration/delay/easing/iterations), computed progress, keyframes, play state, and the animating target. An animation only appears while running/pending — trigger it first.
scrubselector, points, capture, webview_labelPauses the target’s animation and seeks it to N evenly-spaced points (await animation.ready + double-rAF freezes each frame), returning the exact geometry curve (rect + transform + opacity per point). With capture: true, also returns a single contact-sheet filmstrip PNG of the whole arc plus a manifest. CSS-driven animations only (JS/rAF animations are not seekable — errors clearly and suggests sample).
samplerecord, selector, webview_labelReal-time requestAnimationFrame recorder, decoupled from the blocking eval so event-triggered sweeps are catchable: record: true arms a watcher, trigger the animation, then record: false reads the measured per-frame curve, jank stats (dropped frames, max frame gap), and declared-vs-measured duration. Works for any animation including JS/rAF-driven ones.

Parameters:

NameTypeRequiredDescription
actionstringyesOne of: list, scrub, sample
selectorstringfor scrub/sampleCSS selector of the animating element
pointsintegernoNumber of evenly-spaced seek points for scrub (default: 6)
capturebooleannoFor scrub: also return a filmstrip PNG of the arc
recordbooleanfor sampletrue to arm the recorder, false to read results
restorebooleannoscrub: resume the animation afterwards (default true); false leaves it paused at the last point
colsintegernoscrub with capture: filmstrip grid columns (default ≈ √points)
clearbooleannosample read: clear the recorded sessions after returning them
webview_labelstringnoTarget webview window

Filmstrip + transparent windows: scrub’s filmstrip uses native window capture. On Windows that is Windows.Graphics.Capture, which sees transparent / GPU-composited windows. Only its GDI fallback cannot (no DWM redirection surface), and there the capture fails with an actionable error rather than returning a blank frame — use an opaque window, or list / sample / scrub without capture.

Examples:

{"action": "list"}
{"action": "scrub", "selector": "#sweep-toast", "points": 6, "capture": true}
{"action": "sample", "selector": "#sweep-toast", "record": true}
{"action": "sample", "record": false}