Skip to main content
Glama

Configurable Puppeteer MCP Server

by afshawnlotfi

puppeteer_select

Automates selecting elements with Select tags on web pages using CSS selectors and specified values, enabling precise interaction in browser environments.

Instructions

Select an element on the page with Select tag

Input Schema

NameRequiredDescriptionDefault
selectorYesCSS selector for element to select
valueYesValue to select

Input Schema (JSON Schema)

{ "properties": { "selector": { "description": "CSS selector for element to select", "type": "string" }, "value": { "description": "Value to select", "type": "string" } }, "required": [ "selector", "value" ], "type": "object" }

Implementation Reference

  • Handler for the puppeteer_select tool: waits for the CSS selector, selects the specified value using Puppeteer's page.select method, and returns a success or error message.
    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, }; }
  • Input schema definition for puppeteer_select tool, specifying selector and value as required string parameters.
    { 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:18-101 (registration)
    The TOOLS array registers puppeteer_select among other tools, used by ListToolsRequestHandler.
    const TOOLS: Tool[] = [ { name: "puppeteer_navigate", description: "Navigate to a URL", inputSchema: { type: "object", properties: { url: { type: "string" }, }, required: ["url"], }, }, { name: "puppeteer_screenshot", description: "Take a screenshot of the current page or a specific element", inputSchema: { type: "object", properties: { name: { type: "string", description: "Name for the screenshot" }, selector: { type: "string", description: "CSS selector for element to screenshot" }, width: { type: "number", description: "Width in pixels (default: 800)" }, height: { type: "number", description: "Height in pixels (default: 600)" }, }, required: ["name"], }, }, { name: "puppeteer_click", description: "Click an element on the page", inputSchema: { type: "object", properties: { selector: { type: "string", description: "CSS selector for element to click" }, }, required: ["selector"], }, }, { name: "puppeteer_fill", description: "Fill out an input field", inputSchema: { type: "object", properties: { selector: { type: "string", description: "CSS selector for input field" }, value: { type: "string", description: "Value to fill" }, }, required: ["selector", "value"], }, }, { 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"], }, }, { name: "puppeteer_hover", description: "Hover an element on the page", inputSchema: { type: "object", properties: { selector: { type: "string", description: "CSS selector for element to hover" }, }, required: ["selector"], }, }, { name: "puppeteer_evaluate", description: "Execute JavaScript in the browser console", inputSchema: { type: "object", properties: { script: { type: "string", description: "JavaScript code to execute" }, }, required: ["script"], }, }, ];
  • index.ts:414-416 (registration)
    Registers the CallToolRequestSchema handler, which invokes handleToolCall dispatching to puppeteer_select case.
    server.setRequestHandler(CallToolRequestSchema, async (request) => handleToolCall(request.params.name, request.params.arguments ?? {}) );

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

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