Skip to main content
Glama
cortex8

DataForSEO MCP Server

by cortex8

on_page_lighthouse

Analyze web page quality using Google's Lighthouse metrics to measure performance, accessibility, SEO, and best practices for optimization.

Instructions

The OnPage Lighthouse API is based on Google’s open-source Lighthouse project for measuring the quality of web pages and web apps.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
accept_languageNoAccept-Language header value
custom_jsNoCustom JavaScript code to execute
custom_user_agentNoCustom User-Agent header
enable_javascriptNoEnable JavaScript rendering
urlYesURL of the page to parse

Implementation Reference

  • Implements the core tool logic: sends POST request to DataForSEO /v3/on_page/lighthouse/live/json with parameters and processes response or error.
    async handle(params: any): Promise<any> {
      try {
          const response = await this.dataForSEOClient.makeRequest('/v3/on_page/lighthouse/live/json', 'POST', [{
            url: params.url,
            enable_javascript: params.enable_javascript,
            custom_js: params.custom_js,
            custom_user_agent: params.custom_user_agent,
            accept_language: params.accept_language,
          }]);
          return this.validateAndFormatResponse(response);
        } catch (error) {
          return this.formatErrorResponse(error);
        }
    }
  • Defines Zod schema for input parameters: url (required), and optional flags for JS, custom JS, user agent, language.
    getParams(): z.ZodRawShape {
      return {
        url: z.string().describe("URL of the page to parse"),
        enable_javascript: z.boolean().optional().describe("Enable JavaScript rendering"),
        custom_js: z.string().optional().describe("Custom JavaScript code to execute"),
        custom_user_agent: z.string().optional().describe("Custom User-Agent header"),
        accept_language: z.string().optional().describe("Accept-Language header value"),
      };
    }
  • Instantiates LighthouseTool and registers it in the tools map using its name 'on_page_lighthouse', description, params schema, and handle method as handler.
    getTools(): Record<string, ToolDefinition> {
      const tools = [
        new ContentParsingTool(this.dataForSEOClient),
        new InstantPagesTool(this.dataForSEOClient),
        new LighthouseTool(this.dataForSEOClient),
        // Add more tools here
      ];
    
      return tools.reduce((acc, tool) => ({
        ...acc,
        [tool.getName()]: {
          description: tool.getDescription(),
          params: tool.getParams(),
          handler: (params: any) => tool.handle(params),
        },
      }), {});
    }
Behavior1/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. However, it only mentions the tool's basis on Lighthouse without describing key behaviors: what the tool outputs (e.g., performance scores, audit results), whether it performs network requests, any rate limits, authentication needs, or side effects. This leaves the agent guessing about the tool's operation and results.

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

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence that is concise but under-specified—it doesn't front-load critical information about the tool's function. While it avoids waste, it lacks structure that could clarify purpose or usage, making it less helpful than a more informative yet still brief description would be.

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 complexity of a Lighthouse-based tool with 5 parameters, no annotations, and no output schema, the description is incomplete. It fails to explain what the tool returns, how it behaves, or when to use it, leaving significant gaps for an AI agent to understand and invoke the tool correctly in context with its siblings.

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 already documents all 5 parameters (e.g., 'url' for the page to parse, 'enable_javascript' for rendering). The description adds no additional meaning or context about parameters beyond what the schema provides, such as usage examples or constraints. This meets the baseline for high schema coverage but doesn't enhance understanding.

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

Purpose2/5

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

The description states the tool is 'based on Google's open-source Lighthouse project for measuring the quality of web pages and web apps,' which provides some context but is vague about the specific action. It doesn't clearly state what the tool actually does (e.g., run a Lighthouse audit, fetch metrics, generate reports) or distinguish it from sibling tools like 'on_page_content_parsing' or 'on_page_instant_pages.' This is closer to a tautology of the name 'on_page_lighthouse' without specifying the verb.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines1/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There is no guidance on when to use this tool versus alternatives. It doesn't mention any context, prerequisites, or comparisons with sibling tools (e.g., 'on_page_content_parsing' or 'on_page_instant_pages'), leaving the agent with no information on selection criteria. This is a significant gap in usage instructions.

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/cortex8/oyt-dataforseo-mcp-worker'

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