Skip to main content
Glama

wp_seo_analyze_content

Analyze WordPress post content for SEO optimization by checking readability, keyword usage, structure, and technical factors to improve search visibility.

Instructions

Analyze WordPress post content for SEO optimization opportunities including readability, keyword density, structure, and technical factors

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
siteNoSite identifier for multi-site setups
postIdYesWordPress post ID to analyze
analysisTypeNoType of SEO analysis to perform (default: full)
focusKeywordsNoPrimary keywords to analyze for optimization

Implementation Reference

  • MCP handler function for wp_seo_analyze_content tool. Extracts parameters from args, creates logger, instantiates SEOTools if needed, and calls analyzeContent method.
    export async function handleAnalyzeContent(client: WordPressClient, args: Record<string, unknown>): Promise<unknown> {
      const logger = LoggerFactory.tool("wp_seo_analyze_content");
    
      try {
        const seoTools = getSEOToolsInstance();
        const params: SEOToolParams = {
          postId: args.postId as number,
          analysisType: args.analysisType as SEOAnalysisType,
          focusKeywords: args.focusKeywords as string[],
          site: args.site as string,
        };
    
        return await seoTools.analyzeContent(params);
      } catch (error) {
        logger.error("Failed to analyze content", { error, args });
        throw error;
      }
    }
  • Tool schema definition for wp_seo_analyze_content, including input schema with properties for postId (required), analysisType, focusKeywords, and site.
    export const analyzeContentTool: Tool = {
      name: "wp_seo_analyze_content",
      description:
        "Analyze WordPress post content for SEO optimization opportunities including readability, keyword density, structure, and technical factors",
      inputSchema: {
        type: "object",
        properties: {
          postId: {
            type: "number",
            description: "WordPress post ID to analyze",
          },
          analysisType: {
            type: "string",
            enum: ["readability", "keywords", "structure", "full"],
            description: "Type of SEO analysis to perform (default: full)",
          },
          focusKeywords: {
            type: "array",
            items: { type: "string" },
            description: "Primary keywords to analyze for optimization",
          },
          site: {
            type: "string",
            description: "Site identifier for multi-site setups",
          },
        },
        required: ["postId"],
      },
    };
  • Registration mapping in SEOTools.getHandlerForTool that links tool name 'wp_seo_analyze_content' to its handler function handleAnalyzeContent. Used by getTools() for MCP tool registration.
    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 implementation logic of the analysis in SEOTools.analyzeContent: handles caching, validation, client retrieval, performs analysis via performAnalysis, and error handling.
    async analyzeContent(params: SEOToolParams): Promise<SEOAnalysisResult> {
      const siteLogger = LoggerFactory.tool("wp_seo_analyze_content", params.site);
    
      return await siteLogger.time("SEO content analysis", async () => {
        try {
          validateRequired(params, ["postId", "analysisType"]);
          const client = this.getSiteClient(params.site);
    
          // Check cache first
          const cacheKey = `seo:analyze:${params.site}:${params.postId as number}:${params.analysisType}`;
          const cached = await this.getCachedResult(cacheKey);
          if (cached) {
            siteLogger.debug("Cache hit for content analysis", { cacheKey });
            return cached as SEOAnalysisResult;
          }
    
          // Perform analysis (implementation will be added in analyzers)
          const result = await this.performAnalysis(client, params);
    
          // Cache the result
          await this.cacheResult(cacheKey, result, 21600); // 6 hours
    
          return result;
        } catch (_error) {
          handleToolError(_error, "analyze content", {
            site: params.site,
            postId: params.postId as number,
          });
          throw _error; // handleToolError will format it properly
        }
      });
    }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions the analysis types but does not describe the tool's behavior, such as whether it performs read-only operations, requires specific permissions, has rate limits, or what the output format might be. This leaves significant gaps in understanding how the tool operates.

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, well-structured sentence that efficiently conveys the tool's purpose and scope without unnecessary words. It is front-loaded with the main action and includes key details, making it easy to 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 (SEO analysis with multiple parameters) and lack of annotations and output schema, the description is incomplete. It does not explain what the analysis returns, how results are structured, or any behavioral traits like error handling or performance considerations, which are crucial for effective tool 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?

The schema description coverage is 100%, so the schema already documents all parameters thoroughly. The description adds minimal value beyond the schema by listing analysis areas (e.g., readability, keywords) that align with the 'analysisType' enum, but it does not provide additional syntax, format details, or usage examples. This meets the baseline for high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/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 with a specific verb ('Analyze') and resource ('WordPress post content'), and distinguishes it from siblings by specifying the SEO optimization focus, which is unique among the listed tools. It explicitly mentions the analysis areas: readability, keyword density, structure, and technical factors.

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, such as other SEO-related sibling tools like 'wp_seo_bulk_update_metadata' or 'wp_seo_site_audit'. It lacks context about prerequisites, exclusions, or specific scenarios where this analysis is most appropriate.

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