Skip to main content
Glama

scraping_browser_scroll_to

Scroll to specific elements on web pages using CSS selectors for precise data extraction and navigation during web scraping and browser automation.

Instructions

Scroll to a specific element on the page

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
selectorYesCSS selector for the element to scroll to

Implementation Reference

  • Full implementation of the 'scraping_browser_scroll_to' tool, including name, description, input schema (parameters), and the execute handler function that uses Puppeteer-like page.evaluate to scroll the element into view.
    let scraping_browser_scroll_to = {
        name: 'scraping_browser_scroll_to',
        description: 'Scroll to a specific element on the page',
        parameters: z.object({
            selector: z.string().describe('CSS selector for the element to scroll to'),
        }),
        execute: async({selector})=>{
            const page = await (await require_browser()).get_page();
            try {
                await page.evaluate(sel=>{
                    const element = document.querySelector(sel);
                    if (element)
                        element.scrollIntoView({ behavior: 'smooth', block: 'center' });
                    else 
                        throw new Error(`Element with selector "${sel}" not found`);
                    
                }, selector);
                return `Successfully scrolled to element: ${selector}`;
            } catch(e){
                throw new UserError(`Error scrolling to element ${selector}: ${e}`);
            }
        },
    };
  • Registration of the 'scraping_browser_scroll_to' tool in the exported 'tools' array, which is conditionally included based on the presence of API_TOKEN environment variable.
    export const tools = process.env.API_TOKEN ? [
        scraping_browser_navigate,
        scraping_browser_go_back,
        scraping_browser_go_forward,
        scraping_browser_links,
        scraping_browser_click,
        scraping_browser_type,
        scraping_browser_wait_for,
        scraping_browser_screenshot,
        scraping_browser_get_text,
        scraping_browser_get_html,
        scraping_browser_scroll,
        scraping_browser_scroll_to,
    ] : [scraping_browser_activation_instructions];
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states the action but doesn't disclose behavioral traits like what happens if the selector doesn't match any element (error? no-op?), whether scrolling is smooth or instant, if it waits for element visibility, or any side effects. The description is minimal and lacks needed operational context.

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 a single, clear sentence with zero waste. It's appropriately sized for a simple tool and front-loaded with the core action, making it highly concise and well-structured.

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

Completeness2/5

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

Given no annotations and no output schema, the description is incomplete for a browser interaction tool. It doesn't cover error conditions, return values (e.g., success status, new viewport position), or integration with other tools in the scraping context. For a tool that modifies browser state, more behavioral context is needed.

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% with the parameter 'selector' well-documented in the schema. The description adds no additional parameter semantics beyond implying the selector targets an element to scroll to, which is already clear from the schema. Baseline 3 is appropriate when schema does the heavy lifting.

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

Purpose4/5

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

The description clearly states the action ('Scroll to') and target ('a specific element on the page'), which is a specific verb+resource combination. However, it doesn't explicitly differentiate from sibling tools like 'scraping_browser_scroll' (which likely scrolls by amount rather than to element), leaving some ambiguity in sibling context.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing a page to be loaded), when-not scenarios (e.g., if element doesn't exist), or explicit alternatives among the many sibling browser interaction tools.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/dsouza-anush/brightdata-mcp-heroku'

If you have feedback or need assistance with the MCP directory API, please join our Discord server