Skip to main content
Glama
BrowserGenie

BrowserGenie MCP Server

by BrowserGenie

type_text

Types regular text character by character into the currently focused input field, simulating real user input for usernames, passwords, and form data.

Instructions

Type regular text into the currently focused input field. Use this for typing usernames, passwords, search queries, form data, etc. Each character is typed individually like a real user.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
textYesPlain text to type (no special keys - use press_key for those)
delayNoDelay between keystrokes in ms (default: 50). Increase for slower inputs if needed.
tabIdNoTarget tab ID (defaults to active tab)
apiKeyNoAPI key for authentication if enabled

Implementation Reference

  • MCP tool registration named 'type_text'. Defines the tool name, description, input schema (Zod), and handler callback. The handler sends a 'type_text' command via the WebSocket bridge.
    server.tool(
      'type_text',
      'Type regular text into the currently focused input field. Use this for typing usernames, passwords, search queries, form data, etc. Each character is typed individually like a real user.',
      {
        text: z.string().describe('Plain text to type (no special keys - use press_key for those)'),
        delay: z.number().optional().describe('Delay between keystrokes in ms (default: 50). Increase for slower inputs if needed.'),
        tabId: z.number().optional().describe('Target tab ID (defaults to active tab)'),
        apiKey: z.string().optional().describe('API key for authentication if enabled'),
      },
      async ({ text, delay, tabId, apiKey }) => {
        const result = await bridge.sendCommand({
          command: 'type_text',
          params: { text, delay },
          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 ? '...' : ''}"` }] };
      }
    );
  • Input schema for 'type_text': requires 'text' (string), optional 'delay' (number, ms), 'tabId' (number), and 'apiKey' (string).
    {
      text: z.string().describe('Plain text to type (no special keys - use press_key for those)'),
      delay: z.number().optional().describe('Delay between keystrokes in ms (default: 50). Increase for slower inputs if needed.'),
      tabId: z.number().optional().describe('Target tab ID (defaults to active tab)'),
      apiKey: z.string().optional().describe('API key for authentication if enabled'),
    },
  • Handler function for 'type_text'. Receives { text, delay, tabId, apiKey }, sends command via bridge.sendCommand, and returns success message or error.
    async ({ text, delay, tabId, apiKey }) => {
      const result = await bridge.sendCommand({
        command: 'type_text',
        params: { text, delay },
        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 ? '...' : ''}"` }] };
    }
  • WebSocketBridge.sendCommand - the helper that sends the 'type_text' command over WebSocket to the Chrome extension and waits for a response.
    async sendCommand(cmd: BridgeCommand): Promise<BridgeResponse> {
      if (!this.isConnected()) {
        return {
          success: false,
          error: {
            code: 'NOT_CONNECTED',
            message: 'Chrome extension is not connected. Ensure the extension is installed, enabled, and the browser is running.',
          },
        };
      }
    
      const id = crypto.randomUUID();
      const timeout = cmd.timeout ?? DEFAULT_TIMEOUT;
    
      return new Promise<BridgeResponse>((resolve, reject) => {
        const timer = setTimeout(() => {
          this.pending.delete(id);
          resolve({
            success: false,
            error: {
              code: 'TIMEOUT',
              message: `Command '${cmd.command}' timed out after ${timeout}ms`,
            },
          });
        }, timeout);
    
        this.pending.set(id, { resolve, reject, timer });
    
        const message = {
          id,
          type: 'request',
          command: cmd.command,
          params: cmd.params,
          tabId: cmd.tabId,
          apiKey: cmd.apiKey,
          timestamp: Date.now(),
        };
    
        this.client!.send(JSON.stringify(message));
      });
    }
  • Registration call site: registerKeyboardTools is invoked during server setup, which registers the 'type_text' tool on the MCP server.
    registerKeyboardTools(server, bridge);
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It states typing is done 'like a real user,' but lacks details on event simulation (keydown, keypress, keyup) or error handling (e.g., losing focus mid-type). The description is somewhat transparent but could be more specific about underlying mechanics.

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?

Two concise sentences that front-load the core purpose and then add context. Every sentence is informative with no wasted words, making it easy for the agent to parse quickly.

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 simplicity, the description covers the key behavioral aspects (individual keystrokes, realistic typing), usage guidance, and parameter semantics completely. No output schema is needed, and the description is sufficient for an agent to understand and invoke the tool correctly.

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 coverage is 100%, and the description does not add meaning beyond what the schema already provides for the parameters (text, delay, tabId, apiKey). The baseline of 3 is appropriate since the schema already documents the parameters adequately.

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 it types regular text into the currently focused input field, using a specific verb and resource. It distinguishes from siblings by explicitly excluding special keys and referencing press_key for those, helping the agent choose correctly.

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 lists common use cases (usernames, passwords, etc.) and provides an alternative for special keys. It implies the tool is for typing plain text only, but does not explicitly mention when to avoid it beyond that, or prerequisites like focusing the input.

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