Skip to main content
Glama

browser_fill

Automatically populate form fields in web browsers using element selectors and specified values to streamline data entry tasks.

Instructions

Fill a form field

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
instanceIdYesInstance ID
selectorYesElement selector
valueYesValue to fill
timeoutNoTimeout in milliseconds

Implementation Reference

  • The core handler function that executes the browser_fill tool logic using Playwright's page.fill method to fill a form field with the given value.
    private async fill(instanceId: string, selector: string, value: string, timeout: number): Promise<ToolResult> {
      const instance = this.browserManager.getInstance(instanceId);
      if (!instance) {
        return { success: false, error: `Instance ${instanceId} not found` };
      }
    
      try {
        await instance.page.fill(selector, value, { timeout });
        return {
          success: true,
          data: { selector, value, filled: true },
          instanceId
        };
      } catch (error) {
        return {
          success: false,
          error: `Fill failed: ${error instanceof Error ? error.message : error}`,
          instanceId
        };
      }
    }
  • Input schema definition for the browser_fill tool, specifying parameters like instanceId, selector, value, and timeout.
    inputSchema: {
      type: 'object',
      properties: {
        instanceId: {
          type: 'string',
          description: 'Instance ID'
        },
        selector: {
          type: 'string',
          description: 'Element selector',
        },
        value: {
          type: 'string',
          description: 'Value to fill',
        },
        timeout: {
          type: 'number',
          description: 'Timeout in milliseconds',
          default: 30000
        }
      },
      required: ['instanceId', 'selector', 'value']
    }
  • src/tools.ts:237-263 (registration)
    Tool registration in the getTools() method, defining name, description, and input schema for browser_fill.
    {
      name: 'browser_fill',
      description: 'Fill a form field',
      inputSchema: {
        type: 'object',
        properties: {
          instanceId: {
            type: 'string',
            description: 'Instance ID'
          },
          selector: {
            type: 'string',
            description: 'Element selector',
          },
          value: {
            type: 'string',
            description: 'Value to fill',
          },
          timeout: {
            type: 'number',
            description: 'Timeout in milliseconds',
            default: 30000
          }
        },
        required: ['instanceId', 'selector', 'value']
      }
    },
  • src/tools.ts:547-549 (registration)
    Dispatch/registration in the executeTools switch statement that routes browser_fill calls to the fill handler method.
    case 'browser_fill':
      return await this.fill(args.instanceId, args.selector, args.value, args.timeout || 30000);
Behavior2/5

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

With no annotations provided, the description carries full burden but offers minimal behavioral context. It implies a mutation action ('fill') but doesn't disclose error conditions (e.g., if selector fails), side effects, or performance aspects like the timeout parameter's role. It mentions no authentication needs or rate limits, leaving critical operational details unclear.

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 three words, with no wasted language. It front-loads the core purpose immediately, making it easy to parse. Every word earns its place by directly conveying the tool's function.

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 the tool's complexity (interacting with browser instances and DOM elements), no annotations, and no output schema, the description is insufficient. It lacks details on return values, error handling, prerequisites like instanceId usage, and how it integrates with sibling tools. For a browser automation tool with multiple parameters, this leaves too many gaps.

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 parameters (instanceId, selector, value, timeout). The description adds no additional meaning beyond implying 'value' is for filling form fields, but doesn't clarify parameter interactions or usage nuances. Baseline 3 is appropriate as the schema handles most documentation.

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 'Fill a form field' clearly states the action (fill) and target (form field), which is specific and unambiguous. It distinguishes this from siblings like browser_click or browser_type by focusing on form field population, though it doesn't explicitly differentiate from browser_select_option which also interacts with form elements.

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 an active browser instance), contrast with similar tools like browser_type (for typing) or browser_select_option (for dropdowns), or specify when not to use it (e.g., for non-form elements).

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/sailaoda/concurrent-browser-mcp'

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