Skip to main content
Glama

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

TableJSON Schema
NameRequiredDescriptionDefault
clientYesAllowlisted 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_idNoOptional. 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_finalNoWhen true, the visual session clears immediately after this tool resolves. Optional (default false).
selectorYesCSS selector or element reference to focus
visual_reasonYesShort human-readable reason shown in the overlay (for example, "Logging in to GitHub"). Required.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.5/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden and does well: it discloses the return value ('focus confirmation'), multi-agent tab scoping, the TAB_NOT_OWNED cross-agent rejection, and a configurable cap (default 8, 1-64). It omits any permission/auth prerequisites or failure modes beyond tab ownership, but the behavioral coverage is unusually strong for a focus tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loads the core action, then segments 'When to use', 'Related', and 'Multi-agent' into scannable clauses. Dense but every sentence adds distinct, actionable information with no filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a focus tool with no output schema and no annotations, the description supplies the return value, the related-tool map, and the multi-agent/tab-ownership model. Nothing an agent needs to call it correctly is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all five parameters including client, tab_id, is_final, selector, and visual_reason. The description reiterates tab_id resolution semantics ('pass only when this agent owns multiple tabs; auto-resolves otherwise'), which is minor added value; baseline 3 is correct when the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Move keyboard focus to an element') and separates itself from siblings by naming type_text, press_key, and click with their relationships. An agent can distinguish this tool from the many click/type tools without opening any schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicit 'When to use' clause covers both the input-preparation and accessibility-focus-ring cases, and 'Related' names alternatives with the condition that selects each. Nothing about when-to-use-vs-alternatives is left to inference.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.