pilot_fill
Clear and fill input fields or textareas using element references or CSS selectors for browser automation tasks.
Instructions
Clear and fill an input/textarea by @ref or CSS selector.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ref | Yes | Element ref (@e3) or CSS selector | |
| value | Yes | Value to fill |
Implementation Reference
- src/tools/interaction.ts:87-110 (handler)The handler implementation for the `pilot_fill` tool.
server.tool( 'pilot_fill', 'Clear and fill an input/textarea by @ref or CSS selector.', { ref: z.string().describe('Element ref (@e3) or CSS selector'), value: z.string().describe('Value to fill'), }, async ({ ref, value }) => { await bm.ensureBrowser(); try { const resolved = await bm.resolveRef(ref); if ('locator' in resolved) { await resolved.locator.fill(value, { timeout: 5000 }); } else { await bm.getPage().fill(resolved.selector, value, { timeout: 5000 }); } bm.resetFailures(); return { content: [{ type: 'text' as const, text: `Filled ${ref}` }] }; } catch (err) { bm.incrementFailures(); return { content: [{ type: 'text' as const, text: wrapError(err) }], isError: true }; } } ); - src/tools/register.ts:25-25 (registration)Registration of the `pilot_fill` tool in the core toolset.
'pilot_fill',