Skip to main content
Glama
AdsPower

AdsPower LocalAPI MCP Server

Official

select-option

Select specific dropdown options in browser automation by providing CSS selectors and values to interact with web page elements programmatically.

Instructions

Select the option

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
selectorYesThe selector of the option to select, find from the page source code
valueYesThe value of the option to select

Implementation Reference

  • The handler function that executes the logic for the 'select-option' tool: waits for the selector, selects the option by value using Puppeteer page.selectOption, and returns a success message.
    async selectOption({ selector, value }: SelectOptionParams) { browser.checkConnected(); await browser.pageInstance!.waitForSelector(selector); await browser.pageInstance!.selectOption(selector, value); return `Selected option with selector: ${selector} with value: ${value} successfully`;
  • Zod schema defining the input parameters (selector and value) for the 'select-option' tool.
    selectOptionSchema: z.object({ selector: z.string().describe('The selector of the option to select, find from the page source code'), value: z.string().describe('The value of the option to select') }).strict(),
  • Registration of the 'select-option' tool on the MCP server, linking the schema and wrapped handler.
    server.tool('select-option', 'Select the option', schemas.selectOptionSchema.shape, wrapHandler(automationHandlers.selectOption));

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