fill-input
Fill text into specified input fields on web pages using CSS selectors, enabling automated form completion and data entry tasks through browser automation.
Instructions
Fill the input
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| selector | Yes | The selector of the input to fill, find from the page source code | |
| text | Yes | The text to fill in the input |
Implementation Reference
- src/handlers/automation.ts:94-98 (handler)The core handler function for the 'fill-input' tool. It checks browser connection, waits for the selector, fills the input with the provided text using Playwright, and returns a success message.
async fillInput({ selector, text }: FillInputParams) { browser.checkConnected(); await browser.pageInstance!.waitForSelector(selector); await browser.pageInstance!.fill(selector, text); return `Filled input with selector: ${selector} with text: ${text} successfully`; - src/types/schemas.ts:186-189 (schema)Zod schema defining the input parameters for the 'fill-input' tool: 'selector' (CSS selector of the input element) and 'text' (string to fill into the input). Used in tool registration for validation.
fillInputSchema: z.object({ selector: z.string().describe('The selector of the input to fill, find from the page source code'), text: z.string().describe('The text to fill in the input') }).strict(), - src/utils/toolRegister.ts:71-72 (registration)Registration of the 'fill-input' tool in the MCP server using server.tool(), specifying name, description, input schema, and the wrapped handler from automationHandlers.
server.tool('fill-input', 'Fill the input', schemas.fillInputSchema.shape, wrapHandler(automationHandlers.fillInput));