Skip to main content
Glama
merajmehrabi

Puppeteer MCP Server

by merajmehrabi

puppeteer_fill

Fill web form input fields using CSS selectors to automate data entry in browser automation workflows.

Instructions

Fill out an input field

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
selectorYesCSS selector for input field
valueYesValue to fill

Implementation Reference

  • Handler function for puppeteer_fill tool: waits for selector, types the value into the input field, returns success or error message.
    case "puppeteer_fill": try { await page.waitForSelector(args.selector); await page.type(args.selector, args.value); return { content: [{ type: "text", text: `Filled ${args.selector} with: ${args.value}`, }], isError: false, }; } catch (error) { return { content: [{ type: "text", text: `Failed to fill ${args.selector}: ${(error as Error).message}`, }], isError: true, }; }
  • Input schema for puppeteer_fill tool: requires CSS selector and value to fill.
    { 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"], }, },
  • src/server.ts:34-41 (registration)
    Registers all tools from TOOLS array for list request, and dispatches tool calls to handleToolCall function.
    // Setup tool handlers server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: TOOLS, })); server.setRequestHandler(CallToolRequestSchema, async (request) => handleToolCall(request.params.name, request.params.arguments ?? {}, state, server) );

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

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