Skip to main content
Glama
JustasMonkev

MCP Accessibility Scanner

scan_page

Destructive

Identify accessibility violations on web pages by scanning with Axe. Use tags to filter specific WCAG compliance issues and generate detailed reports for remediation.

Instructions

Scan the current page for accessibility violations using Axe

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
violationsTagYesArray of tags to filter violations by. If not specified, all violations are returned.

Implementation Reference

  • The main handler function for the 'scan_page' tool. It uses AxeBuilder to scan the current browser tab for accessibility violations filtered by the provided tags, deduplicates nodes, and streams results to the response including URL summary and detailed violations.
    handle: async (context, params, response) => {
      const tab = context.currentTabOrDie();
      const axe = new AxeBuilder({ page: tab.page }).withTags(params.violationsTag);
    
      const results = await axe.analyze();
    
      response.addResult([
        `URL: ${results.url}`,
        '',
        `Violations: ${results.violations.length}, Incomplete: ${results.incomplete.length}, Passes: ${results.passes.length}, Inapplicable: ${results.inapplicable.length}`,
      ].join('\n'));
    
    
      results.violations.forEach(violation => {
        const uniqueNodes = dedupeViolationNodes(violation.nodes);
    
        response.addResult([
          '',
          `Tags : ${violation.tags}`,
          `Violations: ${JSON.stringify(uniqueNodes, null, 2)}`,
        ].join('\n'));
      });
    },
  • Zod schema defining the input parameters for the 'scan_page' tool, specifically the 'violationsTag' array for filtering Axe violations.
    const scanPageSchema = z.object({
      violationsTag: z
          .array(z.enum(tagValues))
          .min(1)
          .default([...tagValues])
          .describe('Array of tags to filter violations by. If not specified, all violations are returned.')
    });
  • Tool metadata registration within defineTool, specifying name 'scan_page', title, description, input schema reference, and type.
    schema: {
      name: 'scan_page',
      title: 'Scan page for accessibility violations',
      description: 'Scan the current page for accessibility violations using Axe',
      inputSchema: scanPageSchema,
      type: 'destructive',
    },
  • Default export array including the scanPage tool, allowing its registration in the MCP server by importing this module.
    export default [
      snapshot,
      click,
      drag,
      hover,
      selectOption,
      scanPage
    ];
  • Helper function used in the handler to deduplicate Axe violation nodes based on their target and HTML content to avoid redundant reporting.
    const dedupeViolationNodes = (nodes: AxeNode[]): AxeNode[] => {
      const seen = new Set<string>();
      return nodes.filter(node => {
        const key = JSON.stringify({ target: node.target ?? [], html: node.html ?? '' });
        if (seen.has(key))
          return false;
    
        seen.add(key);
        return true;
      });
    };
Behavior3/5

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

Annotations provide readOnlyHint=false, openWorldHint=true, and destructiveHint=true, indicating this is a non-read-only, open-ended, and potentially destructive operation. The description adds that it scans 'the current page' and uses 'Axe', giving implementation context. However, it doesn't explain what 'destructive' means here (e.g., page reload, state changes) or detail output behavior (e.g., format, timing), leaving gaps despite annotations.

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 a single, efficient sentence that front-loads the core purpose without unnecessary words. Every part ('Scan the current page for accessibility violations using Axe') contributes essential information, making it appropriately sized and well-structured for quick understanding.

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

Completeness3/5

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

Given the tool's moderate complexity (accessibility scanning with filtering), annotations cover safety and scope, and schema fully documents the single parameter. However, without an output schema, the description doesn't explain what the scan returns (e.g., violation details, counts), leaving a gap in understanding results. It's adequate but incomplete for effective 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%, with the parameter 'violationsTag' fully documented in the schema as an array of tags to filter violations. The description adds no parameter-specific information beyond what the schema provides, so it meets the baseline for high schema coverage without compensating 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 action ('Scan') and resource ('current page') with the specific purpose of finding 'accessibility violations using Axe'. It distinguishes itself from sibling browser tools by focusing on accessibility scanning rather than navigation, interaction, or monitoring. However, it doesn't explicitly differentiate from potential non-existent accessibility siblings.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing an open browser page), when scanning is appropriate (e.g., after page load), or what happens if used incorrectly. With many sibling browser tools, this lack of context leaves the agent guessing about proper sequencing.

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

Related 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/JustasMonkev/mcp-accessibility-scanner'

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