Skip to main content
Glama

focus

Scroll to, move keyboard input to, or temporarily highlight a target element using a CSS or SeleniumBase selector, without clicking or typing.

Instructions

Scroll to, focus, or highlight an element.

This tool does not click, type, select, hover, or otherwise activate the element. Use click, type_text, or hover_action for those operations.

Args: selector: CSS selector or SeleniumBase selector identifying the target.

action:
    - "scroll_to_element": Scroll the element into the viewport.
    - "focus": Move keyboard focus to the element.
    - "highlight": Temporarily highlight the element for debugging or
      demonstration by changing the border color. May affect timing
      and/or reduce stealth.

timeout: Maximum seconds to wait for the target element. Default: 5.

If there's no matching element found within the timeout, then @handle_sb_errors will return details from the exception raised.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
actionNoscroll_to_element
timeoutNo
selectorYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.3.2
    • addedInput schema / properties / timeout
      Added value: +{
      +  "default": 5,
      +  "title": "Timeout",
      +  "type": "number"
      +}
  2. Addedv1.2.6
  3. Removedv1.2.0
  4. Addedv1.0.2

TDQS

A4.8/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does well: it discloses that 'highlight' changes the border color, may affect timing, and may 'reduce stealth', and that a timeout raises an exception surfaced by @handle_sb_errors. It does not state side effects on page state (e.g., whether focusing can trigger blur/focus handlers or scroll the page layout), leaving a small gap for a tool with UI side effects.

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-loaded purpose sentence, then the exclusion clause, then a clean Args breakdown ordered by importance. Every sentence adds information; there is no filler or restatement of the name.

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?

The tool is non-mutating but has UI side effects and an output schema, so return values need no explanation. Given no annotations, the description supplies the safety profile (does not activate), the enum semantics, the timeout default, and the error path — enough for an agent to invoke it correctly.

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

Parameters5/5

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

Schema description coverage is 0%, but the description compensates fully: it defines `selector` as a CSS or SeleniumBase selector, explains each of the three `action` enum values with their actual effect, and restates the `timeout` semantics and default. Nothing in the schema is left semantically unexplained.

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?

The opening line names a specific verb set (scroll to, focus, highlight) and the resource (an element), and it immediately distinguishes the tool from its siblings by naming the operations it does NOT perform. An agent can separate this from `click`, `scroll`, or `hover_action` 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-not guidance is given: 'This tool does not click, type, select, hover, or otherwise activate the element. Use `click`, `type_text`, or `hover_action` for those operations.' This routes the agent to the correct alternatives with the selecting condition stated.

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