Skip to main content
Glama

validate_accessibility_axe

Analyze website accessibility using Axe to identify WCAG compliance issues with zero false positives, helping developers improve web accessibility.

Instructions

Analyze website accessibility using Axe. Free, open-source, finds ~57% of WCAG issues with zero false positives.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYes
wcagLevelNoWCAG level (wcag2a, wcag2aa, wcag2aaa, wcag21aa, wcag22aa)

Implementation Reference

  • The core handler function `analyzeAxe` that launches a headless Chromium browser using Playwright, navigates to the URL, injects the axe-core library, runs WCAG-specific accessibility tests, processes violations by impact level, and returns structured results including counts and detailed issues.
    export async function analyzeAxe(
      url: string,
      options: AxeOptions = {}
    ): Promise<AxeResult> {
      let browser: Browser | null = null;
      let page: Page | null = null;
    
      try {
        // Launch browser
        browser = await chromium.launch({ headless: true });
        page = await browser.newPage();
    
        // Navigate to page
        await page.goto(url, { timeout: options.timeout || 60000, waitUntil: 'networkidle' });
    
        // Inject axe-core
        await page.addScriptTag({
          url: 'https://cdnjs.cloudflare.com/ajax/libs/axe-core/4.10.2/axe.min.js',
        });
    
        // Run axe analysis
        const wcagLevel = options.wcagLevel || 'wcag2aa';
        const results = await page.evaluate((level) => {
          return (window as any).axe.run({
            runOnly: {
              type: 'tag',
              values: [level],
            },
          });
        }, wcagLevel);
    
        await browser.close();
    
        // Count violations by severity
        const critical = results.violations.filter((v: any) => v.impact === 'critical').length;
        const serious = results.violations.filter((v: any) => v.impact === 'serious').length;
        const moderate = results.violations.filter((v: any) => v.impact === 'moderate').length;
        const minor = results.violations.filter((v: any) => v.impact === 'minor').length;
    
        // Format violations
        const issues: AxeViolation[] = results.violations.map((v: any) => ({
          id: v.id,
          impact: v.impact,
          description: v.description,
          helpUrl: v.helpUrl,
          nodes: v.nodes.length,
        }));
    
        return {
          tool: 'axe',
          success: true,
          url,
          wcagLevel,
          violations: results.violations.length,
          critical,
          serious,
          moderate,
          minor,
          passes: results.passes.length,
          incomplete: results.incomplete.length,
          issues,
        };
      } catch (error) {
        if (browser) {
          await browser.close();
        }
        return {
          tool: 'axe',
          success: false,
          url,
          wcagLevel: options.wcagLevel || 'wcag2aa',
          violations: 0,
          critical: 0,
          serious: 0,
          moderate: 0,
          minor: 0,
          passes: 0,
          incomplete: 0,
          issues: [],
          error: error instanceof Error ? error.message : String(error),
        };
      }
    }
  • index.ts:188-199 (registration)
    MCP tool registration defining the tool name, description, and input schema for the validate_accessibility_axe tool.
    {
      name: 'validate_accessibility_axe',
      description: 'Analyze website accessibility using Axe. Free, open-source, finds ~57% of WCAG issues with zero false positives.',
      inputSchema: {
        type: 'object',
        properties: {
          url: { type: 'string' },
          wcagLevel: { type: 'string', description: 'WCAG level (wcag2a, wcag2aa, wcag2aaa, wcag21aa, wcag22aa)' },
        },
        required: ['url'],
      },
    },
  • Zod validation schema for the tool's input arguments, ensuring URL is valid and wcagLevel is optional string.
    const AxeArgsSchema = z.object({
      url: z.string().url(),
      wcagLevel: z.string().optional(),
    });
  • Dispatcher case in the main MCP callToolRequest handler that validates arguments and delegates to the analyzeAxe implementation.
    case 'validate_accessibility_axe': {
      const validatedArgs = AxeArgsSchema.parse(args);
      const result = await analyzeAxe(validatedArgs.url, {
        wcagLevel: validatedArgs.wcagLevel,
      });
      return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It discloses behavioral traits like 'Free, open-source' and 'finds ~57% of WCAG issues with zero false positives,' which adds context on cost and accuracy. However, it lacks critical details such as rate limits, authentication needs, error handling, or what the analysis entails (e.g., runtime, output format). For a tool with no annotations, this is a significant gap in behavioral disclosure.

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 highly concise and front-loaded, consisting of a single sentence that efficiently conveys key information: purpose, technology, cost, and performance metrics. Every part earns its place without redundancy, making it easy to parse and understand quickly.

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?

Given the tool's complexity (accessibility analysis with parameters), no annotations, no output schema, and moderate schema coverage, the description is incomplete. It lacks details on output format, error cases, prerequisites, or how results are returned, which are crucial for an agent to use the tool effectively. The description provides basic context but falls short of being fully informative.

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 50% (one parameter has a description, one does not). The description adds no specific parameter information beyond what the schema provides; it doesn't explain the 'url' or 'wcagLevel' parameters. Since schema coverage is moderate, the description doesn't compensate for the undocumented parameter, resulting in a baseline score of 3 for minimal added value.

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 tool's purpose: 'Analyze website accessibility using Axe' specifies the verb (analyze) and resource (website accessibility) with the technology (Axe). It distinguishes from siblings by mentioning 'Free, open-source' and 'finds ~57% of WCAG issues with zero false positives,' which differentiates it from other validation tools, though not explicitly naming alternatives. However, it doesn't fully specify scope (e.g., vs. validate_accessibility_wave), keeping it from a perfect 5.

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

Usage Guidelines3/5

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

The description implies usage for accessibility analysis with Axe, but provides no explicit guidance on when to use this tool versus alternatives like validate_accessibility_wave or validate_all_accessibility. It mentions 'Free, open-source' and performance metrics, which hint at context, but lacks clear when/when-not statements or named alternatives, leaving usage somewhat ambiguous.

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/cordlesssteve/webby-mcp'

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