Skip to main content
Glama

puppeteer_fill

Automate input field filling using CSS selectors and specified values for web interaction tasks on Linux-based browser automation systems.

Instructions

Fill out an input field

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
selectorYesCSS selector for input field
valueYesValue to fill

Implementation Reference

  • The handler logic for the puppeteer_fill tool. It waits for the CSS selector to appear on the page, types the provided value into the input field using Puppeteer's page.type method, and returns a success message or an error if the operation fails.
    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.message}`, }], isError: true, }; }
  • Defines the tool metadata including name, description, and input schema (requiring 'selector' and 'value' parameters) for puppeteer_fill, used for tool listing and validation.
    { 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"], }, },
  • index.ts:447-449 (registration)
    Registers the list of available tools (including puppeteer_fill via the TOOLS array) with the MCP server through the ListToolsRequestSchema handler.
    server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: TOOLS, }));
  • index.ts:451-451 (registration)
    Registers the general tool call handler that dispatches to the specific puppeteer_fill case in handleToolCall based on the tool name.
    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/PhialsBasement/MCP-Puppeteer-Linux'

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