Skip to main content
Glama
BrowserGenie

BrowserGenie MCP Server

by BrowserGenie

input_and_type

Automatically click, clear, and type text into form fields, with optional form submission via Enter.

Instructions

One-stop tool for filling form fields. Automatically clicks the input, clears existing text, types your text, and optionally submits with Enter. Use this for search boxes, login forms, registration fields, etc.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
selectorYesCSS selector or XPath to the input/textarea element
selectorTypeNoSelector type: "css" (default) or "xpath"
textYesText to type into the input field
clearFirstNoClear existing text before typing (default: true). Set to false to append.
submitNoPress Enter automatically after typing to submit forms
tabIdNoTarget tab ID (defaults to active tab)
apiKeyNoAPI key for authentication if enabled

Implementation Reference

  • The registerInputTools function defines the 'input_and_type' MCP tool handler. It accepts parameters: selector, selectorType, text, clearFirst, submit, tabId, apiKey. It sends a bridge command named 'input_and_type' with the params and returns the result.
    export function registerInputTools(server: McpServer, bridge: WebSocketBridge) {
      server.tool(
        'input_and_type',
        'One-stop tool for filling form fields. Automatically clicks the input, clears existing text, types your text, and optionally submits with Enter. Use this for search boxes, login forms, registration fields, etc.',
        {
          selector: z.string().describe('CSS selector or XPath to the input/textarea element'),
          selectorType: z.enum(['css', 'xpath']).optional().describe('Selector type: "css" (default) or "xpath"'),
          text: z.string().describe('Text to type into the input field'),
          clearFirst: z.boolean().optional().describe('Clear existing text before typing (default: true). Set to false to append.'),
          submit: z.boolean().optional().describe('Press Enter automatically after typing to submit forms'),
          tabId: z.number().optional().describe('Target tab ID (defaults to active tab)'),
          apiKey: z.string().optional().describe('API key for authentication if enabled'),
        },
        async ({ selector, selectorType, text, clearFirst, submit, tabId, apiKey }) => {
          const result = await bridge.sendCommand({
            command: 'input_and_type',
            params: { selector, selectorType, text, clearFirst, submit },
            tabId,
            apiKey,
          });
          if (!result.success) {
            return { content: [{ type: 'text', text: `Error: ${result.error?.message}` }], isError: true };
          }
          return { content: [{ type: 'text', text: `Typed "${text.substring(0, 50)}${text.length > 50 ? '...' : ''}" into ${selector}` }] };
        }
      );
    }
  • The registerAllTools function in src/tools/index.ts calls registerInputTools, which registers the 'input_and_type' tool on the MCP server.
    export function registerAllTools(server: McpServer, bridge: WebSocketBridge) {
      registerNavigationTools(server, bridge);
      registerTabManagementTools(server, bridge);
      registerKeyboardTools(server, bridge);
      registerScreenshotTools(server, bridge);
      registerClickTools(server, bridge);
      registerInputTools(server, bridge);
      registerDragDropTools(server, bridge);
      registerHoverTools(server, bridge);
    
      registerDevtoolsSourcesTools(server, bridge);
      registerDevtoolsModifyTools(server, bridge);
      registerDevtoolsNetworkTools(server, bridge);
      registerDevtoolsStorageTools(server, bridge);
      registerDevtoolsConsoleTools(server, bridge);
    
      registerAccessibilityTools(server, bridge);
      registerEmulationTools(server, bridge);
      registerElementTools(server, bridge);
      registerAuditTools(server, bridge);
      registerInteractionTools(server, bridge);
      registerMonitoringTools(server, bridge);
      registerQaTools(server, bridge);
      registerGestureTools(server, bridge);
      registerMacroTools(server, bridge);
      registerVisualRegressionTools(server, bridge);
    }
Behavior3/5

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

Without annotations, the description carries full burden for behavioral disclosure. It accurately describes the main sequence (click, clear, type, submit) and default clear behavior, but does not cover edge cases (e.g., element not found, hidden elements, error handling) or specify whether it scrolls to the element.

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 concise (two sentences), front-loaded with the core purpose, and includes essential details without unnecessary words. Every sentence adds value.

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

Completeness3/5

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

Given the complexity (7 parameters, no output schema, no annotations), the description is minimally adequate. It explains what the tool does but omits details like return value, waiting behavior, or error conditions. The high schema coverage compensates partially.

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 input schema has 100% coverage, with each parameter described. The tool description adds context by summarizing the overall workflow, but it does not provide additional meaning beyond the schema for individual parameters. Baseline 3 is appropriate.

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 clearly states the tool's purpose as a 'one-stop tool for filling form fields' and enumerates the automated steps (click, clear, type, optionally submit). It provides explicit use cases like search boxes and login forms, distinguishing it from simpler siblings like type_text or click_element.

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

Usage Guidelines4/5

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

The description suggests appropriate use cases ('search boxes, login forms, registration fields') but does not explicitly specify when not to use this tool or recommend alternative tools for simpler actions. This is clear enough for most agents but lacks exclusion guidance.

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/BrowserGenie/mcp'

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