Skip to main content
Glama

browser_form_fill

Fill form fields on a target URL for automated testing. Supports batch filling with CSS selectors or field names, and smart filling with generated test data by field type.

Instructions

表单填充工具(v1.9.5 起合并 browser_smart_fill)。通过 mode 参数区分子模式:basic(默认,批量填充表单字段并可选提交检测,支持 CSS 选择器模式和字段名模式)/ smart(智能填充单个字段,按 fieldType 自动生成符合格式的测试数据,等价于已废弃的 browser_smart_fill)。

中文详情:

  • 用途:批量或智能填充表单字段并可选提交检测

  • 何时使用:登录/注册表单批量填写时;多字段表单快速测试时;表单提交流程端到端验证时;需要 mock 数据填充表单时

  • 输出:basic 模式返回 { ok, url, filledFields, submitResult, timestamp };smart 模式返回 { success, selector, fieldType, value }

  • 参数:

    • mode (string, 可选):basic(默认)/ smart

    • url (string, basic 模式必填):目标页面 URL

    • selector (string, 可选):表单选择器(basic 模式)或字段选择器(smart 模式必填)

    • fields (object, basic 模式可选):手动指定的字段值

    • fieldType (string, smart 模式必填):字段类型(email/phone/name/address/idCard/number/text/url/date/password)

    • options (object, smart 模式可选):数据生成选项

    • submit (boolean, 可选):basic 模式填充后是否自动提交,默认 true

    • submitSelector (string, 可选):提交按钮选择器

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYes目标页面URL(必填)
modeNo填充模式:basic(默认,批量填充表单)/ smart(智能填充单个字段,自动生成符合 fieldType 的测试数据,等价于已废弃的 browser_smart_fill)basic
fieldsNo手动指定的字段值。支持两种key格式:1) CSS选择器模式(key以#/./[/[/>/:/*开头,如 {"#login-email": "user@test.com", "#login-password": "pass123"});2) 字段名模式(key为input的name属性,如 {"email": "user@test.com", "password": "pass123"})。CSS选择器模式的字段会直接用Playwright定位填充,字段名模式的字段会通过表单自动发现机制匹配。
submitNo填充后是否自动提交
optionsNosmart 模式可选:数据生成选项(如 locale、format 等)
selectorNo表单选择器,默认 'form'form
fieldTypeNosmart 模式必填:字段类型(email/phone/name/address/idCard/number/text/url/date/password)
submitSelectorNo提交按钮选择器,默认自动查找 submit 按钮
Behavior4/5

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

With no annotations, the description covers behavior well: filling forms, optional submission, mode differences, and output shapes. It does not mention prerequisites or handling of missing fields, but overall is transparent.

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?

Description is well-structured with English summary followed by detailed Chinese sections. Every sentence adds useful information without redundancy.

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

Completeness5/5

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

Comprehensive coverage of all parameters, modes, output shapes, and usage scenarios. Despite no output schema, it describes return values. Sibling context and deprecation note are included.

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

Parameters4/5

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

Schema coverage is 100%. The description adds value beyond schema by explaining CSS selector vs field name patterns for 'fields' parameter and providing output format examples.

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

Purpose5/5

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

The description clearly states it is a form filling tool with two modes (basic and smart), and explicitly distinguishes itself from the deprecated browser_smart_fill sibling. Verb 'fill' with resource 'form' is specific.

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

Usage Guidelines5/5

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

The '中文详情' section provides explicit use cases: login/registration forms, multi-field forms, end-to-end submission, mock data filling. It also differentiates when to use basic vs smart mode.

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/validpilot/ai-verify-mcp'

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