browsercat_fill
Automatically populate web form fields using CSS selectors to input specified values for automated data entry and form completion tasks.
Instructions
Fill out an input field
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| selector | Yes | CSS selector for input field | |
| value | Yes | Value to fill |
Implementation Reference
- index.ts:241-260 (handler)The handler for the 'browsercat_fill' tool. It waits for the specified CSS selector to appear, types the provided value into the input field, and returns a success message or error if the operation fails.case "browsercat_fill": try { await page.waitForSelector(args.selector); await page.type(args.selector, args.value); return { content: [{ type: "text", text: `Filled ${args.selector} with: ${args.value}`, }], isError: false, }; } catch (error) { return { content: [{ type: "text", text: `Failed to fill ${args.selector}: ${(error as Error).message}`, }], isError: true, }; }
- index.ts:65-76 (registration)Registration of the 'browsercat_fill' tool in the TOOLS array, including its name, description, and input schema definition.{ name: "browsercat_fill", description: "Fill out an input field", inputSchema: { type: "object", properties: { selector: { type: "string", description: "CSS selector for input field" }, value: { type: "string", description: "Value to fill" }, }, required: ["selector", "value"], }, },