Skip to main content
Glama

browser_submit_form

Automate form submission in web browsers using Selenium WebDriver. Specify element locator and value to submit forms programmatically for testing and automation workflows.

Instructions

Submit a form

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
byYesLocator strategy to find element
valueYesValue for the locator strategy
timeoutNoMaximum time to wait for element in milliseconds

Implementation Reference

  • Registration of the 'browser_submit_form' tool using server.tool, including inline handler that delegates to ActionService.submitForm and error handling.
    server.tool('browser_submit_form', 'Submit a form', { ...locatorSchema }, async ({ by, value }) => {
      try {
        const driver = stateManager.getDriver();
        const actionService = new ActionService(driver);
        await actionService.submitForm({ by, value });
        return {
          content: [{ type: 'text', text: `Submitted form` }],
        };
      } catch (e) {
        return {
          content: [
            {
              type: 'text',
              text: `Error submitting form: ${(e as Error).message}`,
            },
          ],
        };
      }
    });
  • Core handler logic in ActionService that locates the form using LocatorFactory and submits it using Selenium WebDriver's form.submit() method.
    async submitForm(params: LocatorParams): Promise<void> {
      const locator = LocatorFactory.createLocator(params.by, params.value);
      const form = await this.driver.wait(until.elementLocated(locator), params.timeout || 15000);
      await form.submit();
    }
  • Zod schema defining the input parameters for locators (by, value, timeout), spread into the tool's input schema.
    export const locatorSchema = {
      by: z
        .enum(['id', 'css', 'xpath', 'name', 'tag', 'class', 'link', 'partialLink'])
        .describe('Locator strategy to find element'),
      value: z.string().describe('Value for the locator strategy'),
      timeout: z.number().optional().describe('Maximum time to wait for element in milliseconds'),
    };
Behavior1/5

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

No annotations are provided, so the description carries full burden. 'Submit a form' does not disclose behavioral traits such as whether this triggers page navigation, handles validation errors, requires specific page states, or has side effects like form data transmission. It lacks critical context needed for safe and effective use in a browser automation scenario.

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 with a single phrase 'Submit a form', which is front-loaded and wastes no words. However, this conciseness comes at the cost of under-specification, but per scoring rules, it earns full points for brevity and structure.

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

Completeness1/5

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

Given no annotations, no output schema, and a tool that performs a mutation (form submission), the description is completely inadequate. It fails to explain what the tool does beyond the name, lacks behavioral context, and does not compensate for the absence of structured data, leaving the agent with insufficient information for proper use.

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%, so the schema fully documents parameters 'by', 'value', and 'timeout' with descriptions and enum for 'by'. The description adds no meaning beyond this, as it does not mention parameters at all. Baseline 3 is appropriate since the schema does the heavy lifting.

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

Purpose2/5

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

The description 'Submit a form' is a tautology that restates the tool name 'browser_submit_form' without adding specificity. It mentions the verb 'submit' and resource 'form', but fails to distinguish this tool from sibling tools like 'browser_click' or 'browser_type' that might also interact with forms. No additional context about what submission entails is provided.

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

Usage Guidelines1/5

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

There is no guidance on when to use this tool versus alternatives. The description does not mention prerequisites (e.g., requiring a form element to be located first), exclusions, or comparisons to sibling tools like 'browser_click' for button submission. Usage is implied but not explicitly stated, leaving the agent to guess.

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/pshivapr/selenium-mcp'

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