Skip to main content
Glama

select

Automatically select an element with a SELECT tag using a CSS selector and specified value, facilitating browser automation for testing consent management platforms.

Instructions

Select an element with SELECT tag

Input Schema

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

Implementation Reference

  • The handler function for the 'select' tool. It waits for the selector to appear and then selects the specified value in the SELECT element using Puppeteer's page.select method.
    case "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, }; }
  • src/index.ts:79-93 (registration)
    Registration of the 'select' tool in the TOOLS array, defining its name, description, and input schema.
    { name: "select", description: "Select an element with SELECT tag", 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/noisysocks/autoconsent-mcp'

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