fill-input
Automate input field population in AdsPower browser profiles by specifying CSS selectors and text content, enhancing workflow automation with AdsPower LocalAPI MCP Server.
Instructions
Fill the input
Input Schema
TableJSON 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)Implements the 'fill-input' tool logic: checks browser connection, waits for selector, fills the input with text using Playwright, and returns 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 for input validation of the 'fill-input' tool, requiring 'selector' and 'text' fields.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)Registers the 'fill-input' tool with MCP server, providing name, description, input schema, and wrapped handler.server.tool('fill-input', 'Fill the input', schemas.fillInputSchema.shape, wrapHandler(automationHandlers.fillInput));
- src/types/browser.ts:16-16 (schema)TypeScript type definition for FillInputParams, inferred from the Zod fillInputSchema for type safety in handlers.export type FillInputParams = z.infer<typeof schemas.fillInputSchema>;