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
| Name | Required | Description | Default |
|---|---|---|---|
| selector | Yes | The selector of the option to select, find from the page source code | |
| value | Yes | The 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
- src/handlers/automation.ts:100-105 (handler)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`; },
- src/types/schemas.ts:191-194 (schema)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(),
- src/utils/toolRegister.ts:74-75 (registration)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));