Skip to main content
Glama

browser_type

Enables automated text input into specified elements within browser instances, supporting delays and timeouts for precise control in parallel testing or automation workflows.

Instructions

Type text into an element

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
delayNoInput delay in milliseconds
instanceIdYesInstance ID
selectorYesElement selector
textYesText to input
timeoutNoTimeout in milliseconds

Implementation Reference

  • Core handler function that executes the tool logic by typing text into the specified page element using Playwright's page.type() method.
    private async type(instanceId: string, selector: string, text: string, options: TypeOptions): Promise<ToolResult> { const instance = this.browserManager.getInstance(instanceId); if (!instance) { return { success: false, error: `Instance ${instanceId} not found` }; } try { const typeOptions: any = {}; if (options.delay) typeOptions.delay = options.delay; if (options.timeout) typeOptions.timeout = options.timeout; await instance.page.type(selector, text, typeOptions); return { success: true, data: { selector, text, typed: true }, instanceId }; } catch (error) { return { success: false, error: `Type failed: ${error instanceof Error ? error.message : error}`, instanceId }; }
  • Input schema defining parameters for the browser_type tool: instanceId (required), selector (required), text (required), delay (optional), timeout (optional).
    inputSchema: { type: 'object', properties: { instanceId: { type: 'string', description: 'Instance ID' }, selector: { type: 'string', description: 'Element selector', }, text: { type: 'string', description: 'Text to input', }, delay: { type: 'number', description: 'Input delay in milliseconds', default: 0 }, timeout: { type: 'number', description: 'Timeout in milliseconds', default: 30000 } }, required: ['instanceId', 'selector', 'text'] }
  • src/tools.ts:206-236 (registration)
    Tool registration object defining 'browser_type' tool, including name, description, and input schema. Returned by BrowserTools.getTools() for MCP server.
    name: 'browser_type', description: 'Type text into an element', inputSchema: { type: 'object', properties: { instanceId: { type: 'string', description: 'Instance ID' }, selector: { type: 'string', description: 'Element selector', }, text: { type: 'string', description: 'Text to input', }, delay: { type: 'number', description: 'Input delay in milliseconds', default: 0 }, timeout: { type: 'number', description: 'Timeout in milliseconds', default: 30000 } }, required: ['instanceId', 'selector', 'text'] } },
  • TypeScript interface defining optional parameters (delay, timeout) used in the browser_type tool handler.
    export interface TypeOptions { delay?: number; timeout?: number; }
  • src/server.ts:40-45 (registration)
    MCP server registration for listing tools, which exposes the 'browser_type' tool via BrowserTools.getTools().
    this.server.setRequestHandler(ListToolsRequestSchema, async () => { const tools = this.browserTools.getTools(); return { tools: 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