Skip to main content
Glama

browser_form_validate

Automatically detect and test HTML5 form validation rules including required fields, patterns, and length constraints. Outputs a detailed validation report per field.

Instructions

Auto-detect form field validation rules (required, pattern, length, etc.) and run a complete validation flow. Detects HTML5 validation attributes and outputs a detailed report per field.

中文详情:

  • 用途:自动检测表单字段验证规则(必填、格式、长度等),执行完整表单验证流程并输出详细验证报告

  • 何时使用:测试表单校验规则实现是否正确时;提交空表单验证必填提示时;测试 email/url 格式校验时;验证最小/最大长度限制时

  • 输出:{ ok: boolean, url: string, formSelector: string, totalFields: number, fields: array, validationPassed: boolean } — 每项含 { selector, name, type, required, pattern, minLength, maxLength, valid, message }

  • 参数:

    • url (string, 可选):要检测表单的目标 URL,不提供则使用当前页面

    • formSelector (string, 可选):表单选择器,不提供则自动检测页面第一个表单

    • validateSubmit (boolean, 可选):是否尝试提交表单检测验证,默认 true

    • checkRequired (boolean, 可选):是否检测必填字段,默认 true

    • checkPattern (boolean, 可选):是否检测格式模式(email、url 等),默认 true

    • checkLength (boolean, 可选):是否检测长度限制,默认 true

  • 错误:页面无表单抛出 'No form found';URL 不可达抛出 'Navigation failed'

  • 示例:{"url":"https://example.com/register","formSelector":"#signup-form","checkRequired":true}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlNo要检测表单的目标 URL。如果不提供则使用当前页面。
checkLengthNo是否检测长度限制
checkPatternNo是否检测格式模式(email、url等)
formSelectorNo表单选择器。如果不提供则自动检测页面第一个表单。
checkRequiredNo是否检测必填字段
validateSubmitNo是否尝试提交表单检测验证
Behavior4/5

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

With no annotations provided, the description carries full burden. It reveals behaviors: detects HTML5 validation attributes, outputs a detailed report with per-field results, and throws specific errors ('No form found', 'Navigation failed'). It also describes the output shape and default behaviors of parameters. More could be said about side effects or permissions, but it is sufficient.

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

Conciseness3/5

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

The description is thorough but somewhat lengthy, with repeated information in English and Chinese. The structure is good: English summary followed by detailed Chinese sections. However, it could be more concise by merging the English and Chinese parts or reducing redundancy.

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

Completeness4/5

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

Despite lacking an output schema, the description fully details the return value shape, errors, and all 6 parameters. It accounts for edge cases (no form, navigation failure). With no output schema, the description compensates well, making the tool's behavior predictable.

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%, so baseline is 3. The description adds value by providing Chinese explanations for each parameter, an example usage, and contextual details like '自动检测页面第一个表单' for formSelector. This goes beyond the schema descriptions, improving clarity.

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 the tool auto-detects form field validation rules and runs a complete validation flow. It uses specific verbs ('auto-detect', 'run') and resource ('form field validation rules'). It distinguishes from siblings like browser_form_fill (form filling) and browser_smoke_test (general testing) by focusing on validation detection.

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

Usage Guidelines4/5

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

The Chinese section '何时使用' explicitly lists use cases: testing validation rule implementation, verifying required fields, checking email/url format, and length limits. This provides clear context for when to use. However, it does not explicitly state when NOT to use or mention alternatives.

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