Skip to main content
Glama

browser_select

Automates selection of elements in web pages using CSS selectors, enabling precise interaction for penetration testing and vulnerability detection in web applications.

Instructions

Select an element on the page with Select tag using CSS selector

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
selectorYesCSS selector for element to select
valueYesValue to select

Implementation Reference

  • Handler implementation for the 'browser_select' tool. Selects an option in a select element using a CSS selector and value, with retry logic for strict mode violations.
    case ToolName.BrowserSelect: try { await page.locator(args.selector).selectOption(args.value); return { content: [{ type: "text", text: `Selected ${args.selector} with: ${args.value}`, }], isError: false, }; } catch (error) { if((error as Error).message.includes("strict mode violation")) { console.log("Strict mode violation, retrying on first element..."); try { await page.locator(args.selector).first().selectOption(args.value); return { content: [{ type: "text", text: `Selected ${args.selector} with: ${args.value}`, }], isError: false, }; } catch (error) { return { content: [{ type: "text", text: `Failed (twice) to select ${args.selector}: ${(error as Error).message}`, }], isError: true, }; } } return { content: [{ type: "text", text: `Failed to select ${args.selector}: ${(error as Error).message}`, }], isError: true, }; }
  • index.ts:109-120 (registration)
    Registration of the 'browser_select' tool in the TOOLS array, including name, description, and input schema definition.
    { name: ToolName.BrowserSelect, description: "Select an element on the page with Select tag using CSS selector", inputSchema: { type: "object", properties: { selector: { type: "string", description: "CSS selector for element to select" }, value: { type: "string", description: "Value to select" }, }, required: ["selector", "value"], }, },
  • Input schema for the 'browser_select' tool, defining parameters 'selector' and 'value'.
    inputSchema: { type: "object", properties: { selector: { type: "string", description: "CSS selector for element to select" }, value: { type: "string", description: "Value to select" }, }, required: ["selector", "value"], },

Other Tools

Related Tools

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/9olidity/MCP-Server-Pentest'

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