Skip to main content
Glama

browser_type

Simulate typing text into web elements to test accessibility and functionality. Submit text or type slowly to trigger key handlers, ensuring accurate interaction validation.

Instructions

Type text into editable element

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
elementYesHuman-readable element description used to obtain permission to interact with the element
refYesExact target element reference from the page snapshot
slowlyNoWhether to type one character at a time. Useful for triggering key handlers in the page. By default entire text is filled in at once.
submitNoWhether to submit entered text (press Enter after)
textYesText to type into the element

Implementation Reference

  • Handler function that executes the 'browser_type' tool: locates the element, fills or presses sequentially the text (if slowly), and optionally presses Enter if submit is true. Generates code snippets and waits for completion.
    handle: async (tab, params, response) => { const locator = await tab.refLocator(params); await tab.waitForCompletion(async () => { if (params.slowly) { response.setIncludeSnapshot(); response.addCode(`await page.${await generateLocator(locator)}.pressSequentially(${javascript.quote(params.text)});`); await locator.pressSequentially(params.text); } else { response.addCode(`await page.${await generateLocator(locator)}.fill(${javascript.quote(params.text)});`); await locator.fill(params.text); } if (params.submit) { response.setIncludeSnapshot(); response.addCode(`await page.${await generateLocator(locator)}.press('Enter');`); await locator.press('Enter'); } }); },
  • Schema definition for 'browser_type' tool: defines input schema with element selector (from elementSchema), text, optional submit and slowly flags using Zod validation.
    const typeSchema = elementSchema.extend({ text: z.string().describe('Text to type into the element'), submit: z.boolean().optional().describe('Whether to submit entered text (press Enter after)'), slowly: z.boolean().optional().describe('Whether to type one character at a time. Useful for triggering key handlers in the page. By default entire text is filled in at once.'), }); const type = defineTabTool({ capability: 'core', schema: { name: 'browser_type', title: 'Type text', description: 'Type text into editable element', inputSchema: typeSchema, type: 'destructive', },
  • src/tools.ts:38-56 (registration)
    Registration of the 'browser_type' tool (included in keyboard export) by spreading all individual tool modules into the central allTools array.
    export const allTools: Tool<any>[] = [ ...common, ...console, ...dialogs, ...evaluate, ...files, ...form, ...install, ...keyboard, ...navigate, ...network, ...mouse, ...pdf, ...screenshot, ...snapshot, ...tabs, ...wait, ...verify, ];

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/JustasMonkev/mcp-accessibility-scanner'

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