Skip to main content
Glama

a11y-toolkit: Form error testing

a11y_forms
Destructive

Tests form error identification and suggestion (WCAG 3.3.1/3.3.3) by submitting invalid data and checking post-submit DOM for field-associated errors and alerts.

Instructions

Form error testing (3.3.1 Error Identification, 3.3.3 Error Suggestion) — the guided flow no competitor automates: fills every validatable field with INVALID data, really submits, and judges the post-submit DOM — are errors identified in text and associated with the field (aria-invalid + aria-describedby, error summary, role=alert), or does the form swallow them? Native browser validation counts as identification (unless the form has novalidate); forms that navigate on submit are honestly noted as not measurable in-page. Requires local Playwright. Returns JSON: per-field error judgments {field, submitted_value_class, error_identified, announced, suggestion_present} plus an overall 3.3.1/3.3.3 verdict. Use on test/staging forms, or forms you own: invalid data is REALLY submitted. Do not run against production forms that trigger real emails, orders or leads.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "url": "<url>"
    },
    "name": "a11y_forms"
  }
}

Input Schema

NameRequiredDescriptionDefault
urlYesPage URL with the form(s) to test
langNoOutput language (en default)
browserNoBrowser engine (auto = detect the first available)
timeoutNoPage load timeout seconds (45 default)
auth_stateNoPath to a Playwright storage_state JSON to test forms behind login

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv5.27.0
    • addedInput schema / properties / browser
      Added value: +{
      +  "description": "Browser engine (auto = detect the first available)",
      +  "enum": [
      +    "auto",
      +    "chromium",
      +    "firefox",
      +    "webkit",
      +    "chrome",
      +    "msedge"
      +  ],
      +  "type": "string"
      +}
  2. Changed1 schema field changedv5.6.0
    • removedInput schema / browser
      Removed value: -{
      -  "description": "Browser engine (auto = detect the first available)",
      -  "enum": [
      -    "auto",
      -    "chromium",
      -    "firefox",
      -    "webkit",
      -    "chrome",
      -    "msedge"
      -  ],
      -  "type": "string"
      -}
  3. Addedv4.0.0

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already flag destructiveHint=true and openWorldHint=true, but the description adds the operative detail behind that: invalid data is REALLY submitted, so real side effects occur. It also discloses the local Playwright prerequisite, what counts as identification (native validation, unless novalidate), and which cases are honestly reported as not measurable in-page.

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

Conciseness4/5

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

Purpose, criteria, method, and safety warning are all front-loaded in a single dense paragraph with no filler sentences. The phrase 'the guided flow no competitor automates' is promotional rather than informative and is the one clause that does not earn its place.

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?

Even without an output schema, the description enumerates the returned JSON fields (field, submitted_value_class, error_identified, announced, suggestion_present) plus the overall verdict, and covers prerequisites, limits, and destructive side effects. An agent has everything needed to decide and call correctly.

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 all five parameters are already documented, and the description adds nothing per-parameter (no mention of auth_state for logged-in forms, lang, browser, or timeout). Baseline 3 applies where the schema does the semantic work.

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?

States a specific verb chain (fills invalid data, submits, judges post-submit DOM) against a specific resource (forms) mapped to named WCAG criteria 3.3.1/3.3.3. This is unmistakably different from the audit/contrast/keyboard siblings, which inspect static state rather than submit-then-judge.

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?

Gives both a when ('use on test/staging forms, or forms you own') and an explicit when-not ('do not run against production forms that trigger real emails, orders or leads'), plus a measurability caveat for forms that navigate on submit. No sibling is named as an alternative, but the applicability conditions are fully spelled out.

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