run_accessibility_audit
Perform an accessibility audit on web pages using the Chromium ARM64 Browser to ensure compliance and usability for all users. Supports testing workflows on ARM64 devices like Raspberry Pi.
Instructions
Run an accessibility audit on the current page
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- index.js:843-874 (handler)The main handler function that performs a basic accessibility audit by injecting JavaScript to check for images without alt text, unlabeled inputs, and missing headings, then returns the results.async runAccessibilityAudit() { await this.ensureChromium(); const result = await this.sendCDPCommand('Runtime.evaluate', { expression: ` const results = []; const imagesWithoutAlt = Array.from(document.querySelectorAll('img:not([alt])')).length; if (imagesWithoutAlt > 0) { results.push(\`Found \${imagesWithoutAlt} images without alt text\`); } const inputsWithoutLabels = Array.from(document.querySelectorAll('input:not([aria-label]):not([id])')).length; if (inputsWithoutLabels > 0) { results.push(\`Found \${inputsWithoutLabels} inputs without proper labels\`); } const headings = Array.from(document.querySelectorAll('h1, h2, h3, h4, h5, h6')); if (headings.length === 0) { results.push('No heading structure found on page'); } JSON.stringify(results.length > 0 ? results : ['Basic accessibility checks passed']); `, returnByValue: true }); const auditResults = JSON.parse(result.result?.value || '[]'); return { content: [{ type: 'text', text: `Accessibility Audit Results:\\n${auditResults.join('\\n')}` }], }; }
- index.js:279-286 (registration)Tool registration in the ListToolsRequestSchema response, including name, description, and input schema (no required parameters).{ name: 'run_accessibility_audit', description: 'Run an accessibility audit on the current page', inputSchema: { type: 'object', properties: {}, }, },
- index.js:379-380 (registration)Dispatch case in the CallToolRequestSchema handler that routes the tool call to the runAccessibilityAudit method.case 'run_accessibility_audit': return await this.runAccessibilityAudit();
- index.js:1064-1064 (helper)Usage of the runAccessibilityAudit method within the comprehensive run_audit_mode tool.results.accessibility = await this.runAccessibilityAudit();
- index.js:282-285 (schema)Input schema definition for the tool (empty properties, no parameters required).inputSchema: { type: 'object', properties: {}, },