Skip to main content
Glama

scraping_browser_type

Type text into web page elements using CSS selectors to automate form filling and data entry during web scraping and browser automation.

Instructions

Type text into an element

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
selectorYesCSS selector for the element to type into
textYesText to type
submitNoWhether to submit the form after typing (press Enter)

Implementation Reference

  • The execute handler function that performs the typing action in the browser using page.fill and optionally page.press.
    execute: async({selector, text, submit})=>{
        const page = await (await require_browser()).get_page();
        try {
            await page.fill(selector, text);
            if (submit)
                await page.press(selector, 'Enter');
            return `Successfully typed "${text}" into element: `
            +`${selector}${submit ? ' and submitted the form' : ''}`;
        } catch(e){
            throw new UserError(`Error typing into element ${selector}: ${e}`);
        }
    },
  • Zod schema defining the input parameters for the scraping_browser_type tool: selector, text, and optional submit.
    parameters: z.object({
        selector: z.string()
            .describe('CSS selector for the element to type into'),
        text: z.string().describe('Text to type'),
        submit: z.boolean().optional()
            .describe('Whether to submit the form after typing (press Enter)'),
    }),
  • Registration of scraping_browser_type in the exported tools array (line 313 specifically), conditional on 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?

With no annotations provided, the description carries full burden for behavioral disclosure but offers minimal information. It mentions typing but doesn't cover important aspects like whether this requires a loaded page, what happens if the selector doesn't exist, whether typing simulates human behavior, or what side effects might occur. The description is insufficient for a mutation tool with zero annotation coverage.

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 extremely concise at just four words, with zero wasted language. It's front-loaded with the core action and gets straight to the point without unnecessary elaboration.

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?

For a mutation tool with no annotations and no output schema, the description is incomplete. It doesn't explain what happens after typing, what errors might occur, or what the tool returns. Given the complexity of browser interaction and the lack of structured safety information, 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?

The schema description coverage is 100%, providing complete documentation for all three parameters (selector, text, submit). The description adds no additional parameter semantics beyond what's already in the schema, so it meets the baseline of 3 where the 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 ('Type text') and target ('into an element'), providing a specific verb+resource combination. However, it doesn't differentiate itself from potential sibling tools like 'scraping_browser_click' or 'scraping_browser_navigate' that might also interact with page elements, missing full sibling distinction.

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. With many sibling tools available for web interaction and data extraction, there's no indication of appropriate contexts, prerequisites, or exclusions for this specific typing functionality.

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