focus
Set an element as the keyboard input target to prepare it for typing or accessibility navigation. Returns confirmation that the element is ready.
Instructions
Move keyboard focus to an element. Returns focus confirmation. When to use: to prepare an element for keyboard input, or to bring an element into the accessibility focus ring. Related: type_text (type into a focused input), press_key (send keystrokes to focused element), click (also focuses the clicked element). Multi-agent: agent-scoped tabs; cross-agent reject with TAB_NOT_OWNED; cap configurable (default 8, 1-64). Pass tab_id only when this agent owns multiple tabs; auto-resolves otherwise.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| client | Yes | Allowlisted client label. Validated against the shared v0.9.36 server/extension allowlist (see mcp/src/tools/visual-session.ts -- MCP_VISUAL_CLIENT_LABELS). Required. | |
| tab_id | No | Optional. Tab id this action targets. Omit when the calling agent owns exactly one tab; pass to disambiguate when the agent owns multiple. Single-tab agents and legacy popup/sidepanel/autopilot do not need to pass this. | |
| is_final | No | When true, the visual session clears immediately after this tool resolves. Optional (default false). | |
| selector | Yes | CSS selector or element reference to focus | |
| visual_reason | Yes | Short human-readable reason shown in the overlay (for example, "Logging in to GitHub"). Required. |