Skip to main content
Glama
AdsPower

AdsPower LocalAPI MCP Server

Official

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

NameRequiredDescriptionDefault
selectorYesThe selector of the input to fill, find from the page source code
textYesThe text to fill in the input

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "selector": { "description": "The selector of the input to fill, find from the page source code", "type": "string" }, "text": { "description": "The text to fill in the input", "type": "string" } }, "required": [ "selector", "text" ], "type": "object" }

Implementation Reference

  • 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`;
  • 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(),
  • 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));
  • TypeScript type definition for FillInputParams, inferred from the Zod fillInputSchema for type safety in handlers.
    export type FillInputParams = z.infer<typeof schemas.fillInputSchema>;

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/AdsPower/local-api-mcp-typescript'

If you have feedback or need assistance with the MCP directory API, please join our Discord server