Skip to main content
Glama
sharozdawa

content-optimizer-mcp

analyze_keyword

Analyze SERP data for keywords to identify word counts, heading patterns, common topics, and SERP features in top results.

Instructions

Analyze SERP data for a keyword. Returns simulated top 10 results with word counts, heading counts, common topics, and SERP features.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
keywordYesThe keyword to analyze

Implementation Reference

  • Registration and handler definition for the 'analyze_keyword' tool.
    server.tool(
      "analyze_keyword",
      "Analyze SERP data for a keyword. Returns simulated top 10 results with word counts, heading counts, common topics, and SERP features.",
      {
        keyword: z.string().describe("The keyword to analyze"),
      },
      async ({ keyword }) => {
        const result = analyzeSERP(keyword);
        return {
          content: [
            {
              type: "text" as const,
              text: JSON.stringify(result, null, 2),
            },
          ],
        };
      }
    );
  • The core logic function 'analyzeSERP' which generates the keyword analysis data.
    function analyzeSERP(keyword: string) {
      const rng = seededRandom(keyword.toLowerCase());
      const topics = getKeywordTopics(keyword);
    
      const results = [];
      for (let i = 0; i < 10; i++) {
        const wordCount = 800 + Math.floor(rng() * 2500);
        const headingCount = 3 + Math.floor(rng() * 12);
        const h2Count = 2 + Math.floor(rng() * 8);
        const h3Count = Math.floor(rng() * 6);
    
        results.push({
          position: i + 1,
          title: `${keyword.charAt(0).toUpperCase() + keyword.slice(1)}: ${["Complete Guide", "Everything You Need to Know", "Ultimate Guide", "Best Practices", "How to Get Started", "Expert Tips", "A Comprehensive Overview", "Step-by-Step Guide", "What You Should Know", "Top Strategies"][i]}`,
          wordCount,
          headingCount,
          h2Count,
          h3Count,
          estimatedReadingTime: `${Math.ceil(wordCount / 250)} min`,
        });
      }
    
      const avgWordCount = Math.round(results.reduce((s, r) => s + r.wordCount, 0) / 10);
      const avgHeadings = Math.round(results.reduce((s, r) => s + r.headingCount, 0) / 10);
    
      return {
        keyword,
        topResults: results,
        averages: {
          wordCount: avgWordCount,
          headingCount: avgHeadings,
          recommendedWordCount: Math.round(avgWordCount * 1.1),
        },
        commonTopics: topics,
        serpFeatures: {
          featuredSnippet: rng() > 0.4,
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 the tool returns 'simulated' results, which hints at non-live data, but lacks details on data sources, accuracy, rate limits, or error handling. For a tool with no annotation coverage, this leaves significant gaps in understanding its operational behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/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 and details the output without unnecessary words. Every element ('Analyze SERP data', 'simulated top 10 results', specific metrics) contributes directly to understanding the tool's function.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (keyword analysis with simulated data), no annotations, and no output schema, the description is partially complete. It specifies the output format but omits behavioral traits like data freshness or limitations. It adequately covers the basic operation but lacks depth for full contextual understanding without structured support.

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 input schema has 100% description coverage, with the single parameter 'keyword' documented as 'The keyword to analyze'. The description adds no additional semantic context beyond this, such as format examples or constraints. With high schema coverage, the 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.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('Analyze SERP data for a keyword') and the resource ('keyword'), with precise output details ('simulated top 10 results with word counts, heading counts, common topics, and SERP features'). It distinguishes itself from siblings like 'check_readability' or 'find_missing_topics' by focusing on keyword SERP analysis rather than content evaluation or topic discovery.

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 prerequisites, exclusions, or compare it to sibling tools like 'get_content_recommendations' or 'score_content', leaving the agent to infer usage context solely from the purpose statement.

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/sharozdawa/content-optimizer'

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