Skip to main content
Glama
AdsPower

AdsPower LocalAPI MCP Server

Official

select-option

Use a specific selector and value to select an option in a web page, enabling precise interaction with elements via the AdsPower LocalAPI MCP Server.

Instructions

Select the option

Input Schema

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

Input Schema (JSON Schema)

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

Implementation Reference

  • The core handler function `selectOption` that checks connection, waits for selector, selects the option using Playwright's page.selectOption, and returns 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 input parameters for select-option: selector (string) and value (string).
    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(),
  • Registers the 'select-option' tool on the MCP server with name, description, schema shape, and wrapped automationHandlers.selectOption.
    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