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 28 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 or REST at POST /api/tools/{tool_name}.

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, environment}


list_app_dir

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

Parameters:

NameTypeRequiredDescription
dir_typestringnoOne of: data, config, log, local_data (default: data)
subpathstringnoSubdirectory to list within the chosen directory

Returns: {path, entries: [{name, size, is_dir, modified}]}


read_app_file

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

Parameters:

NameTypeRequiredDescription
pathstringyesFile path relative to the directory root
dir_typestringnoOne of: data, config, log, local_data (default: data)

Returns: {content, encoding, size} — UTF-8 text or base64-encoded binary.


query_db

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

Parameters:

NameTypeRequiredDescription
sqlstringyesSQL query (SELECT only)
db_pathstringnoPath to database file (auto-discovers if omitted)
paramsarraynoBind parameters for the query

Examples:

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

Returns: {columns, rows, row_count}


Webview & IPC Tools

eval_js

Evaluate JavaScript in the webview and return the result.

Parameters:

NameTypeRequiredDescription
expressionstringyesJavaScript expression or statements to evaluate
webview_labelstringnoTarget webview (defaults to “main” or first visible)

Examples:

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

Bare expressions are auto-wrapped with return. Multi-statement code and async/await are supported.


dom_snapshot

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

Parameters:

NameTypeRequiredDescription
webview_labelstringnoTarget webview

Returns: Tree of elements with ref, role, name, children, and bounding box data.


find_elements

Search for elements by CSS selector or text content.

Parameters:

NameTypeRequiredDescription
selectorstringnoCSS selector (alias: css)
textstringnoText content to search for
rolestringnoARIA role to filter by
webview_labelstringnoTarget webview

Examples:

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

invoke_command

Invoke a Tauri command from the backend.

Parameters:

NameTypeRequiredDescription
commandstringyesCommand name
argsobjectnoArguments to pass

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.


verify_state

Compare frontend and backend state to detect drift.

Parameters:

NameTypeRequiredDescription
frontend_exprstringnoJS expression for frontend state
backend_stateobjectnoExpected backend state to compare

Example:

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

detect_ghost_commands

Find commands invoked by the frontend that are not registered in the backend registry.

Parameters: None required.

Returns: List of ghost commands with invocation counts.


check_ipc_integrity

Verify the health of IPC communication.

Parameters: None required.

Returns: {healthy, total_calls, pending, stale, errored}


wait_for

Wait for a condition to become true, polling until timeout.

Parameters:

NameTypeRequiredDescription
conditionstringyesOne of: selector, selector_gone, text, text_gone, url
valuestringyesThe selector, text, or URL pattern to match
timeout_msnumbernoMax wait time in ms (default: 5000)

Example:

{"condition": "selector", "value": ".modal.open", "timeout_ms": 3000}
{"condition": "url", "value": "/dashboard"}

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)

Example:

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

resolve_command

Resolve a natural language description to registered commands.

Parameters:

NameTypeRequiredDescription
querystringyesNatural language description

Example:

{"query": "show settings"}

get_registry

List all registered commands with their metadata.

Parameters: None.


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

Get detailed diagnostic information about the plugin state.

Parameters: None.


Compound Tools

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

interact

Element interactions with actionability checks.

ActionParametersDescription
clickref_idClick an element
hoverref_idHover over an element
focusref_idFocus an element
scroll_into_viewref_idScroll element into viewport
selectref_id, valueSelect an option

Example:

{"action": "click", "ref_id": "e3"}
{"action": "hover", "ref_id": "e12"}

input

Text input and keyboard operations.

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

Example:

{"action": "fill", "ref_id": "e5", "value": "hello@example.com"}
{"action": "type", "ref_id": "e5", "text": "Hello"}
{"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)
listList all window labels
managelabel, operationminimize/unminimize/maximize/unmaximize/close
resizelabel, width, heightResize a window
move_tolabel, x, yMove a window
set_titlelabel, titleChange window title

Example:

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

storage

Browser storage operations.

ActionParametersDescription
getkeyGet localStorage value
setkey, valueSet localStorage value
deletekeyDelete localStorage key
cookiesGet all cookies

Example:

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

Navigation and history operations.

ActionParametersDescription
go_tourlNavigate to a URL (http/https only)
backGo back in history
historyGet navigation history log
dialogsGet dialog log (alerts, confirms, prompts)

Example:

{"action": "go_to", "url": "https://example.com"}
{"action": "history"}

recording

Time-travel recording for session capture and replay.

ActionParametersDescription
startStart recording events
stopStop recording and return session
checkpointlabelCreate a named checkpoint
eventssince, limitGet recorded events
exportExport full session data
importsessionImport a session for replay

Example:

{"action": "start"}
{"action": "checkpoint", "label": "after-login"}
{"action": "stop"}

inspect

CSS inspection, accessibility, and performance profiling.

ActionParametersDescription
stylesref_id, propertiesGet computed CSS styles
boundsref_idsGet bounding boxes with box model
highlightref_id, color, labelDraw debug overlay on element
accessibilityRun WCAG accessibility audit
performanceGet performance metrics

Example:

{"action": "styles", "ref_id": "e3", "properties": ["color", "font-size"]}
{"action": "bounds", "ref_ids": ["e1", "e2", "e3"]}
{"action": "accessibility"}
{"action": "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)
removeRemove injected CSS

Example:

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

logs

Access all captured logs from the application.

ActionParametersDescription
consolesince, levelConsole log entries
networksinceNetwork request log
ipcsince, limitIPC command log
navigationNavigation history
dialogsDialog interactions
eventssinceEvent stream
slow_ipcthreshold_msIPC calls slower than threshold

Example:

{"action": "console", "level": "error"}
{"action": "network"}
{"action": "slow_ipc", "threshold_ms": 100}