browsercat_select
Select specific options from dropdown menus using CSS selectors to automate form interactions and web navigation tasks.
Instructions
Select an option from a dropdown menu
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| selector | Yes | CSS selector for select element | |
| value | Yes | Value to select |
Implementation Reference
- index.ts:262-281 (handler)Handler implementation for the 'browsercat_select' tool. Waits for the selector, selects the option with the given value using Puppeteer's page.select, and returns success or error message.case "browsercat_select": try { await page.waitForSelector(args.selector); await page.select(args.selector, args.value); return { content: [{ type: "text", text: `Selected ${args.selector} with: ${args.value}`, }], isError: false, }; } catch (error) { return { content: [{ type: "text", text: `Failed to select ${args.selector}: ${(error as Error).message}`, }], isError: true, }; }
- index.ts:77-88 (schema)Schema definition for the 'browsercat_select' tool, including name, description, and input schema requiring 'selector' and 'value' parameters.{ name: "browsercat_select", description: "Select an option from a dropdown menu", inputSchema: { type: "object", properties: { selector: { type: "string", description: "CSS selector for select element" }, value: { type: "string", description: "Value to select" }, }, required: ["selector", "value"], }, },
- index.ts:421-423 (registration)Registration of the tools list, which includes the 'browsercat_select' tool schema, via the ListToolsRequestSchema handler.server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: TOOLS, }));
- index.ts:425-427 (registration)Registration of the CallToolRequestSchema handler, which dispatches to handleToolCall containing the 'browsercat_select' case.server.setRequestHandler(CallToolRequestSchema, async (request) => handleToolCall(request.params.name, request.params.arguments ?? {}) );