Skip to main content
Glama

type_text

Automate web interactions by typing text into specified input fields using CSS selectors. Customize keystroke delays for precise control over text input.

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 implementation for the 'type_text' tool. Validates input with TypeTextSchema, then uses Playwright's currentPage.fill() to input the text into the specified selector.
    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 (string), text (string), delay (number, default 100ms). Note: delay is not used in the handler.
    const TypeTextSchema = z.object({ selector: z.string(), text: z.string(), delay: z.number().default(100) });
  • src/index.ts:196-218 (registration)
    Tool registration in the ListTools response, defining name, description, and inputSchema 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/AutoProbeMCP'

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