Skip to main content
Glama

type_text

Enter text into specified input fields using CSS selectors with customizable keystroke delays. Enables precise automation in browser interactions via MCP Browser Server.

Instructions

Type text into an input field

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
delayNoDelay between keystrokes in milliseconds
selectorYesCSS selector for the input element
textYesText to type

Implementation Reference

  • Handler for the 'type_text' tool. Validates arguments with TypeTextSchema, uses Playwright's page.fill() to input text into the specified selector, ignores delay parameter, and returns a confirmation message.
    case 'type_text': { if (!currentPage) { throw new Error('No browser page available. Launch a browser first.'); } const params = TypeTextSchema.parse(args); await currentPage.fill(params.selector, params.text); return { content: [ { type: 'text', text: `Typed "${params.text}" into element: ${params.selector}` } ] }; }
  • Zod schema defining the input parameters for the type_text tool: selector (CSS selector), text (string to type), delay (optional ms between keystrokes, default 100).
    const TypeTextSchema = z.object({ selector: z.string(), text: z.string(), delay: z.number().default(100) });
  • src/index.ts:196-218 (registration)
    Registration of the 'type_text' tool in the ListToolsRequestSchema handler response, providing name, description, and JSON schema matching the Zod schema.
    { name: 'type_text', description: 'Type text into an input field', inputSchema: { type: 'object', properties: { selector: { type: 'string', description: 'CSS selector for the input element' }, text: { type: 'string', description: 'Text to type' }, delay: { type: 'number', default: 100, description: 'Delay between keystrokes in milliseconds' } }, required: ['selector', 'text'] } },

Other Tools

Related 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/Wladastic/mcp-browser-server'

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