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` };
      }
    },
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. 'Fill multiple form fields at once' implies a write/mutation operation, but doesn't disclose important behavioral traits like whether this requires the form to be in a particular state, what happens if fields don't exist, whether it triggers form submission, or any error handling. The description is too minimal for a mutation tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise at just 6 words, with zero wasted language. Every word contributes to understanding the tool's purpose, making it front-loaded and efficient despite its brevity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a mutation tool with no annotations and no output schema, the description is inadequate. It doesn't explain what happens after filling (e.g., does it return success/failure, what errors might occur), doesn't provide context about the form interaction lifecycle, and leaves critical behavioral questions unanswered given the tool's complexity.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, with the schema clearly documenting that 'fields' is an object mapping selectors to text values. The description adds minimal value beyond this by mentioning 'multiple form fields' which aligns with the object structure, but doesn't provide additional context about selector formats, validation, or practical examples.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('fill') and target ('multiple form fields at once'), providing a specific verb+resource combination. However, it doesn't differentiate from sibling tools like 'type' or 'select' that might also interact with form elements, which prevents a perfect score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'type' or 'select' from the sibling list. It mentions 'multiple form fields at once' which implies a batch operation, but doesn't explicitly state when this is preferred over individual field interactions or what prerequisites might exist.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

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

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