Skip to main content
Glama

get_seo_analysis

Analyze website SEO performance and gain actionable recommendations by auditing URL, emulating device type, and optionally including detailed metrics.

Instructions

Get SEO analysis and recommendations for a website

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
deviceNoDevice to emulate (default: desktop)desktop
includeDetailsNoInclude detailed metrics and recommendations
urlYesURL to audit

Implementation Reference

  • MCP tool handler for 'get_seo_analysis' that runs SEO analysis via helper, processes results including audits if requested, structures response with recommendations, and handles errors.
    server.tool(
      "get_seo_analysis",
      "Get SEO analysis and recommendations for a website",
      detailedAuditSchema,
      async ({ url, device, includeDetails }) => {
        try {
          const result = await getSeoAnalysis(url, device, includeDetails);
    
          const data: Record<string, unknown> = {
            seoScore: result.seoScore,
            fetchTime: result.fetchTime,
            includeDetails,
          };
    
          if (includeDetails && "audits" in result) {
            data.audits = result.audits.map((audit) => ({
              title: audit.title,
              score: audit.score !== null ? Math.round((audit.score || 0) * 100) : null,
              description: audit.description,
              displayValue: audit.displayValue || "N/A",
            }));
          }
    
          const structuredResult = createStructuredAudit("SEO Analysis", result.url, result.device, data, [
            "Optimize meta titles and descriptions",
            "Implement structured data markup",
            "Ensure mobile-friendly responsive design",
            "Improve page loading speed",
            "Create XML sitemap and robots.txt",
          ]);
    
          return {
            content: [
              {
                type: "text" as const,
                text: JSON.stringify(structuredResult, null, 2),
              },
            ],
          };
        } catch (error: unknown) {
          const errorMessage = error instanceof Error ? error.message : String(error);
          return {
            content: [
              {
                type: "text" as const,
                text: JSON.stringify(
                  {
                    error: "SEO analysis failed",
                    url,
                    device: device || "desktop",
                    message: errorMessage,
                  },
                  null,
                  2,
                ),
              },
            ],
            isError: true,
          };
        }
      },
    );
  • Input schema (Zod) for the get_seo_analysis tool, defining url, device, and includeDetails parameters.
    export const detailedAuditSchema = {
      url: baseSchemas.url,
      device: baseSchemas.device,
      includeDetails: baseSchemas.includeDetails,
    };
  • Core helper function that performs Lighthouse SEO audit, returns score and optional detailed audits.
    export async function getSeoAnalysis(url: string, device: "desktop" | "mobile" = "desktop", includeDetails = false) {
      const result = await runLighthouseAudit(url, ["seo"], device);
      const categoryData = result.categories.seo;
    
      const baseData = {
        url: result.url,
        device: result.device,
        seoScore: categoryData?.score || 0,
        fetchTime: result.fetchTime,
      };
    
      if (includeDetails) {
        const { audits } = await getDetailedAuditResults(url, "seo", device);
        return { ...baseData, audits };
      }
    
      return baseData;
    }
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 states the tool 'gets' analysis and recommendations, implying a read-only operation, but doesn't cover aspects like rate limits, authentication needs, response format, or potential side effects. This leaves significant gaps for an agent to understand how to interact with it effectively.

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 without any wasted words. It's appropriately sized for the tool's complexity, making it easy to parse 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 lack of annotations and output schema, the description is incomplete. It doesn't explain what the analysis includes, the format of recommendations, or how results are returned. For a tool with 3 parameters and no structured output documentation, more context is needed to guide an 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 description adds no parameter-specific information beyond what's in the input schema, which has 100% coverage with clear descriptions for all three parameters (url, device, includeDetails). Since the schema does the heavy lifting, the baseline score of 3 is appropriate, as the description doesn't compensate or add extra meaning.

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's purpose with a specific verb ('Get') and resource ('SEO analysis and recommendations for a website'), making it immediately understandable. However, it doesn't explicitly differentiate itself from sibling tools like 'run_audit' or 'get_performance_score', which might also provide analysis, though the SEO focus is implied.

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 doesn't mention prerequisites, context, or exclusions, and with sibling tools like 'run_audit' and 'get_performance_score' available, there's no indication of how this SEO-specific tool fits into the broader analysis workflow.

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

Related 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/danielsogl/lighthouse-mcp-server'

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