pilot_type
Simulates character-by-character typing into the focused element for rich text editors or fields with keystroke events. Use for autocomplete or keypress reactions; for standard inputs, use pilot_fill instead.
Instructions
Type text character-by-character into the currently focused element, simulating real keyboard input. Use when the user wants to type into a contenteditable div, rich text editor, or a field that reacts to individual keystrokes (e.g., autocomplete, keypress events). For standard / elements, prefer pilot_fill which is faster.
Parameters:
text: The text string to type
submit: Set to true to press Enter after typing (useful for search fields and forms)
Returns: Character count typed and whether Enter was pressed.
Errors:
"No element is focused": Nothing is focused on the page. Use pilot_click on the target field first.
Timeout: The page became unresponsive during typing.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | Text to type | |
| submit | No | Press Enter after typing |
Implementation Reference
- src/tools/interaction.ts:223-261 (handler)The 'pilot_type' tool handler registered via server.tool(). It types text character-by-character into the focused element using Playwright's keyboard.type(). Accepts 'text' (string) and optional 'submit' (boolean) parameters. Supports extension-based execution as well.
server.tool( 'pilot_type', `Type text character-by-character into the currently focused element, simulating real keyboard input. Use when the user wants to type into a contenteditable div, rich text editor, or a field that reacts to individual keystrokes (e.g., autocomplete, keypress events). For standard <input>/<textarea> elements, prefer pilot_fill which is faster. Parameters: - text: The text string to type - submit: Set to true to press Enter after typing (useful for search fields and forms) Returns: Character count typed and whether Enter was pressed. Errors: - "No element is focused": Nothing is focused on the page. Use pilot_click on the target field first. - Timeout: The page became unresponsive during typing.`, { text: z.string().describe('Text to type'), submit: z.boolean().optional().describe('Press Enter after typing'), }, async ({ text, submit }) => { await bm.ensureBrowser(); try { const ext = bm.getExtension(); if (ext) { await bm.extSend('type', { text }); if (submit) await bm.extSend('press', { key: 'Enter' }); bm.resetFailures(); return { content: [{ type: 'text' as const, text: `Typed ${text.length} characters${submit ? ' + Enter' : ''}` }] }; } const page = bm.getPage(); await page.keyboard.type(text); if (submit) await page.keyboard.press('Enter'); bm.resetFailures(); return { content: [{ type: 'text' as const, text: `Typed ${text.length} characters${submit ? ' + Enter' : ''}` }] }; } catch (err) { bm.incrementFailures(); return { content: [{ type: 'text' as const, text: wrapError(err) }], isError: true }; } } ); - src/tools/interaction.ts:237-240 (schema)Zod schema for pilot_type input parameters: 'text' (z.string()) and optional 'submit' (z.boolean()).
{ text: z.string().describe('Text to type'), submit: z.boolean().optional().describe('Press Enter after typing'), }, - src/tools/register.ts:21-27 (registration)The tool name 'pilot_type' is listed in the CORE_TOOLS set, meaning it's included in all profiles (core, standard, full). The actual registration is via registerInteractionTools() which calls server.tool('pilot_type', ...).
const CORE_TOOLS = new Set([ 'pilot_navigate', 'pilot_snapshot', 'pilot_snapshot_diff', 'pilot_click', 'pilot_fill', 'pilot_type',