Skip to main content
Glama

fill_form

Automatically populate multiple web form fields simultaneously using CSS selectors to streamline data entry and reduce manual input time.

Instructions

Fill multiple form fields at once

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fieldsYesObject with selector as key and value as text to fill

Implementation Reference

  • Core implementation of the fill_form tool. Loops through the fields object, ensuring the browser is launched, and fills each form field using Playwright's page.fill() method.
    async fillForm(fields) { await this.ensureLaunched(); for (const [selector, value] of Object.entries(fields)) { await this.page.fill(selector, value); } }
  • Input schema for the fill_form tool, specifying an object 'fields' where keys are CSS selectors and values are strings to input.
    inputSchema: { type: 'object', properties: { fields: { type: 'object', additionalProperties: { type: 'string' }, description: 'Object with selector as key and value as text to fill' } }, required: ['fields'] },
  • Registration of the fill_form tool in the createPlaywrightTools function, including name, description, schema, and a handler that delegates to the browser instance's fillForm method.
    { name: 'fill_form', description: 'Fill multiple form fields at once', inputSchema: { type: 'object', properties: { fields: { type: 'object', additionalProperties: { type: 'string' }, description: 'Object with selector as key and value as text to fill' } }, required: ['fields'] }, handler: async ({ fields }) => { await browser.fillForm(fields); return { success: true, message: `Filled ${Object.keys(fields).length} form fields` }; } },

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/zypin-testing/zypin-mcp'

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