Skip to main content
Glama

wp_seo_get_live_data

Retrieve live SEO data from WordPress posts to analyze metadata, check configurations, and get optimization recommendations for improved search visibility.

Instructions

Retrieve live SEO data from WordPress including plugin-specific metadata and configurations

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
siteNoSite identifier for multi-site setups
postIdYesWordPress post ID to get SEO data for
includeAnalysisNoInclude SEO analysis of the live data
includeRecommendationsNoInclude optimization recommendations

Implementation Reference

  • Defines the Tool object for 'wp_seo_get_live_data' including name, description, and input schema requiring postId.
    export const getLiveSEODataTool: Tool = {
      name: "wp_seo_get_live_data",
      description: "Retrieve live SEO data from WordPress including plugin-specific metadata and configurations",
      inputSchema: {
        type: "object",
        properties: {
          postId: {
            type: "number",
            description: "WordPress post ID to get SEO data for",
          },
          includeAnalysis: {
            type: "boolean",
            description: "Include SEO analysis of the live data",
          },
          includeRecommendations: {
            type: "boolean",
            description: "Include optimization recommendations",
          },
          site: {
            type: "string",
            description: "Site identifier for multi-site setups",
          },
        },
        required: ["postId"],
      },
    };
  • Registers the handler mapping for 'wp_seo_get_live_data' to 'handleGetLiveSEOData' in the getHandlerForTool function, used by getTools() for MCP registration.
    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,
    };
  • The registered MCP handler function that parses arguments and delegates to SEOTools instance's getLiveSEOData method.
    /**
     * Handle get live SEO data request
     */
    export async function handleGetLiveSEOData(client: WordPressClient, args: Record<string, unknown>): Promise<unknown> {
      const logger = LoggerFactory.tool("wp_seo_get_live_data");
    
      try {
        const seoTools = getSEOToolsInstance();
        const params: SEOToolParams = {
          postId: args.postId as number,
          includeAnalysis: args.includeAnalysis as boolean,
          includeRecommendations: args.includeRecommendations as boolean,
          site: args.site as string,
        };
    
        return await seoTools.getLiveSEOData(params);
      } catch (error) {
        logger.error("Failed to get live SEO data", { error, args });
        throw error;
      }
    }
  • Core tool logic implementation that retrieves live SEO data from WordPress site using SEOWordPressClient, performs analysis, and structures the response with post details and statistics.
    /**
     * Get live SEO data for multiple posts
     */
    async getLiveSEOData(params: SEOToolParams & { maxPosts?: number }): Promise<unknown> {
      const siteLogger = LoggerFactory.tool("wp_seo_get_live_data", params.site);
    
      return await siteLogger.time("Get live SEO data", async () => {
        try {
          const seoClient = await this.getSEOClient(params.site);
    
          // Get all posts with SEO data
          const postsWithSEO = await seoClient.getAllPostsWithSEO({
            maxPosts: params.maxPosts || 20,
            includePages: true,
          });
    
          // Analyze the SEO data
          const analysis = this.analyzeLiveSEOData(postsWithSEO);
    
          const result = {
            totalContent: postsWithSEO.length,
            contentWithSEO: postsWithSEO.filter((p) => p.seoData).length,
            analysis,
            posts: postsWithSEO.map((post) => ({
              id: post.id,
              title: post.title?.rendered,
              type: post.type,
              url: post.link,
              seoData: post.seoData
                ? {
                    hasTitle: !!post.seoData.title,
                    hasDescription: !!post.seoData.description,
                    hasFocusKeyword: !!post.seoData.focusKeyword,
                    plugin: post.seoData.plugin,
                    lastModified: post.seoData.lastModified,
                  }
                : null,
            })),
            retrievedAt: new Date().toISOString(),
          };
    
          siteLogger.info("Live SEO data retrieved", {
            totalContent: result.totalContent,
            withSEO: result.contentWithSEO,
            plugin: analysis.detectedPlugin,
          });
    
          return result;
        } catch (_error) {
          handleToolError(_error, "get live SEO data", {
            site: params.site,
            maxPosts: params.maxPosts,
          });
          throw _error;
        }
      });
    }
Behavior2/5

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

With no annotations provided, the description carries full burden but offers minimal behavioral insight. It mentions retrieving 'live' data but doesn't disclose whether this is a read-only operation, requires authentication, has rate limits, or what the output format might be. For a tool with no annotation coverage, this is inadequate.

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 front-loads the core purpose. It avoids redundancy and wastes no words, though it could be slightly more structured by separating key components like scope or constraints.

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?

For a tool with no annotations and no output schema, the description is insufficient. It doesn't explain what 'live SEO data' entails, how plugin-specific metadata is structured, or what the return values look like. Given the complexity implied by parameters like 'includeAnalysis' and 'includeRecommendations', more context is needed 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%, so the schema fully documents all four parameters. The description adds no additional parameter semantics beyond implying SEO data retrieval, which the schema already covers with parameter descriptions like 'WordPress post ID to get SEO data for'. Baseline 3 is appropriate when schema does the heavy lifting.

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 verb ('Retrieve') and resource ('live SEO data from WordPress'), specifying it includes 'plugin-specific metadata and configurations'. This distinguishes it from generic data retrieval tools, though it doesn't explicitly differentiate from sibling SEO tools like 'wp_seo_analyze_content' or 'wp_seo_generate_metadata'.

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?

No guidance is provided on when to use this tool versus alternatives. The description doesn't mention prerequisites, appropriate contexts, or comparisons to sibling tools like 'wp_seo_analyze_content' or 'wp_seo_generate_metadata', leaving the agent without usage direction.

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