run_seo_audit
Perform an SEO audit on the current webpage to analyze optimization, identify issues, and improve search engine performance using Chromium ARM64 Browser for web testing on ARM64 devices.
Instructions
Run an SEO audit on the current page
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- index.js:906-946 (handler)The handler function for 'run_seo_audit' tool. It ensures Chromium is running, evaluates JavaScript in the browser context to check for SEO issues like missing title, meta description, H1 tags, and canonical link, then returns the results.async runSEOAudit() { await this.ensureChromium(); const result = await this.sendCDPCommand('Runtime.evaluate', { expression: ` const results = []; const title = document.querySelector('title'); if (!title || title.textContent.trim().length === 0) { results.push('Missing or empty title tag'); } else if (title.textContent.length > 60) { results.push('Title tag is too long (>60 characters)'); } const metaDesc = document.querySelector('meta[name="description"]'); if (!metaDesc || metaDesc.getAttribute('content').trim().length === 0) { results.push('Missing or empty meta description'); } const h1Tags = document.querySelectorAll('h1'); if (h1Tags.length === 0) { results.push('No H1 tag found'); } else if (h1Tags.length > 1) { results.push('Multiple H1 tags found'); } const canonical = document.querySelector('link[rel="canonical"]'); if (!canonical) { results.push('Missing canonical link'); } JSON.stringify(results.length > 0 ? results : ['Basic SEO checks passed']); `, returnByValue: true }); const seoResults = JSON.parse(result.result?.value || '[]'); return { content: [{ type: 'text', text: `SEO Audit Results:\\n${seoResults.join('\\n')}` }], }; }
- index.js:383-384 (registration)Tool dispatch registration in the CallToolRequestSchema handler switch statement, which calls the runSEOAudit method when 'run_seo_audit' is invoked.case 'run_seo_audit': return await this.runSEOAudit();
- index.js:295-302 (schema)Tool registration in the ListToolsRequestSchema response, including the tool name, description, and empty input schema (no parameters required).{ name: 'run_seo_audit', description: 'Run an SEO audit on the current page', inputSchema: { type: 'object', properties: {}, }, },