Skip to main content
Glama
cploujoux

Puppeteer MCP Server

by cploujoux

puppeteer_select

Use this tool to select an element on a web page by specifying a CSS selector and the desired value, enabling precise interaction with dropdowns or selectable elements in browser automation.

Instructions

Select an element on the page with Select tag

Input Schema

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

Implementation Reference

  • Handler for the 'puppeteer_select' tool. Waits for the selector to appear, selects the specified value in the select element, and returns a success message or error if it fails.
    case "puppeteer_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, }; }
  • Tool definition including name, description, and input schema for 'puppeteer_select'. Defines required parameters: selector (CSS selector for the select element) and value (option value to select). This is part of the TOOLS array used for tool listing.
    { name: "puppeteer_select", description: "Select an element on the page 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"], }, },
  • index.ts:459-461 (registration)
    Registers the list of tools, including 'puppeteer_select', by handling ListToolsRequestSchema and returning the TOOLS array.
    server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: TOOLS, }));

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/cploujoux/mcp-puppeteer'

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