Skip to main content
Glama

Hover / Click / Drag

hover_action

Hover over an element, click another after hovering, or drag and drop onto a target using CSS selectors.

Instructions

Hover over an element, optionally click another, or drag-and-drop.

Use this tool for hover interactions, hover-triggered menus, and drag-and-drop operations.

Args: selector: The primary element selector. For action="hover", this is the element to hover over. For action="hover_and_click", this is the element to hover over before clicking 'secondary_selector'. For action="drag_and_drop", this is the draggable source element.

secondary_selector:
    The secondary element selector.
    Required for action="hover_and_click", where it identifies
    the element to click after hovering 'selector'.
    Required for action="drag_and_drop", where it identifies the
    destination/drop target.
    Not used for action="hover".

action:
    - "hover": Hover over 'selector' only.
    - "hover_and_click": Hover over 'selector', then click
      'secondary_selector' after a short moment has passed.
    - "drag_and_drop": Drag 'selector' and drop it onto
      'secondary_selector'.

timeout: Maximum seconds to wait for 'selector'.
    For drag_and_drop, the same timeout applies to secondary_selector.
    For hover_and_click, SeleniumBase uses its own short wait for
    secondary_selector; this parameter does not extend that secondary
    wait.

Returns: A confirmation message describing the performed operation's result.

Error behavior: If a required element cannot be found or interacted with within the applicable wait period, or if an error occurs during the action, the resulting exception message is returned through @handle_sb_errors. Failing actions such as failed hover_and_click will raise exceptions.

When not to use: - Do not use this tool to click if you don't need to hover an element before clicking another; use 'click' instead.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
actionNohover
timeoutNo
selectorYes
secondary_selectorNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changedv4.54.4
    • addedInput schema / properties / secondary_selector
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Secondary Selector"
      +}
    • addedInput schema / properties / selector
      Added value: +{
      +  "title": "Selector",
      +  "type": "string"
      +}
    • removedInput schema / properties / selector1
      Removed value: -{
      -  "title": "Selector1",
      -  "type": "string"
      -}
    • removedInput schema / properties / selector2
      Removed value: -{
      -  "anyOf": [
      -    {
      -      "type": "string"
      -    },
      -    {
      -      "type": "null"
      -    }
      -  ],
      -  "default": null,
      -  "title": "Selector2"
      -}
    • addedInput schema / properties / timeout
      Added value: +{
      +  "default": 5,
      +  "title": "Timeout",
      +  "type": "number"
      +}
    • changedInput schema / required
      Previous value: -[
      -  "selector1"
      -]New value: +[
      +  "selector"
      +]
  2. Changed2 schema fields changedv4.54.3
    • changedInput schema / properties / action / default
      Previous value: -"none"New value: +"hover"
    • changedInput schema / properties / action / enum
      Previous value: -[
      -  "none",
      -  "click",
      -  "drag_and_drop"
      -]New value: +[
      +  "hover",
      +  "hover_and_click",
      +  "drag_and_drop"
      +]
  3. Addedv4.53.8

TDQS

A5/5.0
Behavior5/5

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

With no annotations provided, the description carries the full burden and does so thoroughly. It discloses error behavior (exceptions are returned via @handle_sb_errors), timeout semantics for each action, and the fact that hover_and_click uses a separate internal wait not extended by the timeout parameter. These are exactly the behavioral details an agent needs.

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?

The description is well-structured with clear sections (intro, Args, Returns, Error behavior, When not to use) and every sentence provides necessary information. It is detailed without being redundant—no filler or repeated schema defaults.

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?

Given the tool's complexity (three distinct actions, conditional parameter requirements, timeout nuances), the description covers all operational aspects. It explains return values as a confirmation message, error paths, and explicitly names the sibling alternative. Even with an output schema present, the description is fully self-sufficient.

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%, so the description must compensate entirely. It fully explains each parameter: selector's role per action, secondary_selector's requirements for hover_and_click and drag_and_drop, the action enum values, and the timeout's conditional behavior. This adds substantial meaning beyond the raw schema.

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 description opens with a specific verb-resource statement: 'Hover over an element, optionally click another, or drag-and-drop.' It clearly distinguishes this tool from the sibling 'click_element' by explicitly stating the hover prerequisite and naming the alternative in the 'When not to use' section.

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?

It explicitly states when to use the tool ('hover interactions, hover-triggered menus, and drag-and-drop operations') and when not to use it ('Do not use this tool to click if you don't need to hover... use click instead'). This gives the agent clear routing criteria relative to siblings.

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