Skip to main content
Glama

wp_seo_site_audit

Analyze WordPress site SEO with technical, content, and performance audits to identify optimization opportunities and improve search visibility.

Instructions

Perform comprehensive SEO audit of the WordPress site including technical, content, and performance analysis

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
siteNoSite identifier for multi-site setups
auditTypeNoType of audit to perform (default: full)
maxPagesNoMaximum number of pages to audit (default: 100)
includeExternalLinksNoInclude external link validation in audit
forceNoForce refresh, bypassing cached audit results

Implementation Reference

  • Primary MCP handler function that processes tool invocation parameters and delegates to the core SEOTools.performSiteAudit method.
    export async function handlePerformSiteAudit(client: WordPressClient, args: Record<string, unknown>): Promise<unknown> {
      const logger = LoggerFactory.tool("wp_seo_site_audit");
    
      try {
        const seoTools = getSEOToolsInstance();
        const params: SEOToolParams = {
          auditType: args.auditType as "content" | "performance" | "full" | "technical",
          force: args.force as boolean,
          site: args.site as string,
        };
    
        // Add optional parameters
        if (args.maxPages) {
          params.maxPages = args.maxPages as number;
        }
        if (args.includeExternalLinks) {
          params.includeExternalLinks = args.includeExternalLinks as boolean;
        }
    
        return await seoTools.performSiteAudit(params);
      } catch (error) {
        logger.error("Failed to perform site audit", { error, args });
        throw error;
      }
    }
  • Tool schema definition including name, description, and input schema validation for wp_seo_site_audit.
    export const performSiteAuditTool: Tool = {
      name: "wp_seo_site_audit",
      description:
        "Perform comprehensive SEO audit of the WordPress site including technical, content, and performance analysis",
      inputSchema: {
        type: "object",
        properties: {
          auditType: {
            type: "string",
            enum: ["technical", "content", "performance", "full"],
            description: "Type of audit to perform (default: full)",
          },
          maxPages: {
            type: "number",
            description: "Maximum number of pages to audit (default: 100)",
          },
          includeExternalLinks: {
            type: "boolean",
            description: "Include external link validation in audit",
          },
          force: {
            type: "boolean",
            description: "Force refresh, bypassing cached audit results",
          },
          site: {
            type: "string",
            description: "Site identifier for multi-site setups",
          },
        },
        required: [],
      },
    };
  • Tool registration mapping that associates 'wp_seo_site_audit' with its handler function handlePerformSiteAudit within the getHandlerForTool method used by getTools().
    private getHandlerForTool(toolName: string): unknown {
      const handlers: Record<string, unknown> = {
        wp_seo_analyze_content: handleAnalyzeContent,
        wp_seo_generate_metadata: handleGenerateMetadata,
        wp_seo_bulk_update_metadata: handleBulkUpdateMetadata,
        wp_seo_generate_schema: handleGenerateSchema,
        wp_seo_validate_schema: handleValidateSchema,
        wp_seo_suggest_internal_links: handleSuggestInternalLinks,
        wp_seo_site_audit: handlePerformSiteAudit,
        wp_seo_track_serp: handleTrackSERPPositions,
        wp_seo_keyword_research: handleKeywordResearch,
        wp_seo_test_integration: handleTestSEOIntegration,
        wp_seo_get_live_data: handleGetLiveSEOData,
      };
    
      return (
        handlers[toolName] ||
        (() => {
          throw new Error(`Unknown SEO tool: ${toolName}`);
        })
      );
    }
  • Core helper method in SEOTools class that manages caching, client retrieval, and delegates the actual audit execution to SiteAuditor.
    async performSiteAudit(params: SEOToolParams): Promise<SiteAuditResult> {
      const siteLogger = LoggerFactory.tool("wp_seo_site_audit", params.site);
    
      return await siteLogger.time("Perform site audit", async () => {
        try {
          const client = this.getSiteClient(params.site);
    
          // Cache key for audit results (1 hour TTL)
          const cacheKey = `seo:audit:${params.site}:${params.auditType || "full"}`;
          const cached = await this.getCachedResult(cacheKey);
          if (cached && (!params.force as boolean)) {
            return cached as SiteAuditResult;
          }
    
          // Perform audit (implementation will be added)
          const audit = await this.executeSiteAudit(client, params);
    
          // Cache for 1 hour
          await this.cacheResult(cacheKey, audit, 3600);
    
          return audit;
        } catch (_error) {
          handleToolError(_error, "perform site audit", {
            site: params.site,
            auditType: params.auditType,
          });
          throw _error;
        }
      });
    }
  • Main audit execution logic in SiteAuditor class that orchestrates technical, content, architecture, performance, and accessibility audits, collects issues, calculates scores, and generates recommendations.
    async performSiteAudit(params: SEOToolParams): Promise<SiteAuditResult> {
      this.logger.info("Starting comprehensive site audit", {
        site: params.site,
        auditScope: {
          technical: this.config.includeTechnical,
          content: this.config.includeContent,
          architecture: this.config.includeArchitecture,
          performance: this.config.includePerformance,
          accessibility: this.config.includeAccessibility,
        },
      });
    
      const startTime = Date.now();
      const issues: AuditIssue[] = [];
      const sections: AuditSection[] = [];
      const recommendations: string[] = [];
    
      try {
        // Get site data
        const siteData = await this.collectSiteData(params);
    
        // Technical SEO audit
        if (this.config.includeTechnical) {
          const technicalResults = await this.auditTechnicalSEO(siteData, params);
          sections.push(technicalResults.section);
          issues.push(...technicalResults.issues);
          if (this.config.includeRecommendations) {
            recommendations.push(...technicalResults.recommendations);
          }
        }
    
        // Content quality audit
        if (this.config.includeContent) {
          const contentResults = await this.auditContentQuality(siteData, params);
          sections.push(contentResults.section);
          issues.push(...contentResults.issues);
          if (this.config.includeRecommendations) {
            recommendations.push(...contentResults.recommendations);
          }
        }
    
        // Site architecture audit
        if (this.config.includeArchitecture) {
          const architectureResults = await this.auditSiteArchitecture(siteData, params);
          sections.push(architectureResults.section);
          issues.push(...architectureResults.issues);
          if (this.config.includeRecommendations) {
            recommendations.push(...architectureResults.recommendations);
          }
        }
    
        // Performance audit
        if (this.config.includePerformance) {
          const performanceResults = await this.auditPerformance(siteData, params);
          sections.push(performanceResults.section);
          issues.push(...performanceResults.issues);
          if (this.config.includeRecommendations) {
            recommendations.push(...performanceResults.recommendations);
          }
        }
    
        // Accessibility audit
        if (this.config.includeAccessibility) {
          const accessibilityResults = await this.auditAccessibility(siteData, params);
          sections.push(accessibilityResults.section);
          issues.push(...accessibilityResults.issues);
          if (this.config.includeRecommendations) {
            recommendations.push(...accessibilityResults.recommendations);
          }
        }
    
        // Filter issues by severity
        const filteredIssues = this.filterIssuesBySeverity(issues);
    
        // Calculate overall score
        const overallScore = this.calculateOverallScore(sections, filteredIssues);
    
        const auditResult: SiteAuditResult = {
          timestamp: new Date().toISOString(),
          siteUrl: siteData.siteUrl,
          overallScore,
          sections,
          issues: filteredIssues,
          recommendations: this.config.includeRecommendations ? recommendations : [],
          summary: this.generateAuditSummary(sections, filteredIssues),
          processingTime: Date.now() - startTime,
        };
    
        this.logger.info("Site audit completed", {
          overallScore,
          totalIssues: filteredIssues.length,
          criticalIssues: filteredIssues.filter((i) => i.severity === IssueSeverity.CRITICAL).length,
          processingTime: auditResult.processingTime,
        });
    
        return auditResult;
      } catch (_error) {
        this.logger.error("Site audit failed", {
          _error: _error instanceof Error ? _error.message : String(_error),
        });
        throw _error;
      }
    }
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 of behavioral disclosure. It mentions 'comprehensive SEO audit' but does not specify whether this is a read-only operation, if it requires specific permissions, how long it might take, or what the output format is. For a tool with 5 parameters and no annotations, this lack of detail is a significant gap.

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?

The description is a single, efficient sentence that clearly states the tool's purpose. It is front-loaded with the main action and includes key scope details without unnecessary elaboration. However, it could be slightly more structured by explicitly mentioning the parameters or output, but it avoids waste.

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 (5 parameters, no annotations, no output schema), the description is insufficient. It does not explain what the audit returns, how results are formatted, or any behavioral traits like execution time or error handling. For a comprehensive audit tool, more context is needed to guide the agent effectively.

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?

The schema description coverage is 100%, meaning all parameters are documented in the input schema. The description does not add any additional meaning or context beyond what the schema provides, such as explaining the implications of 'auditType' choices or 'force' refresh. Baseline score of 3 is appropriate as the schema handles the parameter documentation adequately.

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 performs a 'comprehensive SEO audit' of a WordPress site, specifying the scope includes 'technical, content, and performance analysis.' It uses specific verbs ('perform comprehensive SEO audit') and identifies the resource ('WordPress site'), but does not explicitly differentiate from sibling tools like 'wp_seo_analyze_content' or 'wp_seo_keyword_research,' which might have overlapping purposes.

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 does not mention any prerequisites, exclusions, or comparisons with sibling tools such as 'wp_seo_analyze_content' or 'wp_performance_benchmark,' leaving the agent to infer usage based on the tool name alone.

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/docdyhr/mcp-wordpress'

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