VLM Vision Detection¶
When the accessibility tree does not yield a match, the ax_find_visual MCP
tool can fall back to a vision model that locates the element from a
screenshot and a natural-language description.
Where the Model Runs¶
AXTerminator does not run or configure a vision model itself, and it reads no
VLM API key. It hands the work to the MCP client through sampling
(sampling/createMessage), so the element is located by whichever model your
agent already uses.
Usage¶
Call the tool with the connected app and a description:
{
"name": "ax_find_visual",
"arguments": {
"app": "Safari",
"description": "the blue Save button in the toolbar"
}
}
How It Works¶
- If
AXTERMINATOR_PRIORITY_MODE=explicitand the accessibility tree already holds a candidate scoring at least 0.3 for the description, the tool returns that element withvisual_skipped: trueand never takes a screenshot. - Otherwise the tool checks whether the client advertises the MCP sampling
capability. If it does not, the call returns an error suggesting you capture
the app with
ax_screenshotand run an external vision model yourself. - With sampling available, the tool takes a screenshot and returns
screenshot_b64plus a ready-madesampling_requestforsampling/createMessage. - Your client sends that request to its own model, which replies with
{"found": true, "x": <int>, "y": <int>, "description": "..."}. - Feed those coordinates to
ax_click_at.
ax_find_visual -> screenshot + sampling request
|
client model (sampling/createMessage)
|
{"found": true, "x": 450, "y": 120}
|
ax_click_at
Tips¶
- Be specific. "blue Save button in toolbar" beats "save button".
- Use it as a fallback.
ax_findagainst the accessibility tree is faster and needs no model round trip. - Set
AXTERMINATOR_PRIORITY_MODE=explicitif you want the accessibility tree to win whenever it can answer, which skips the screenshot entirely.