Skip to main content
Glama
ravinwebsurgeon

DataForSEO MCP Server

on_page_content_parsing

Parse webpage content to extract structured data including links, headings, and text for SEO analysis and content processing.

Instructions

This endpoint allows parsing the content on any page you specify and will return the structured content of the target page, including link URLs, anchors, headings, and textual content.

Input Schema

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

Implementation Reference

  • The `handle` method implements the tool's core logic by sending a POST request to the DataForSEO `/v3/on_page/content_parsing/live` endpoint with the provided parameters and processing/formatting the response accordingly.
    async handle(params: { 
      url: string; 
      enable_javascript?: boolean; 
      custom_js?: string; 
      custom_user_agent?: string; 
      accept_language?: string; 
    }): Promise<any> {
      try {
        const response = await this.dataForSEOClient.makeRequest('/v3/on_page/content_parsing/live', '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,
          markdown_view: true
        }]);
        console.error(JSON.stringify(response));
        if(defaultGlobalToolConfig.fullResponse || this.supportOnlyFullResponse()){
          let data = response as DataForSEOFullResponse;
          this.validateResponseFull(data);
          let result = data.tasks[0].result;
          return this.formatResponse(result);
        }
        else{
          let data = response as DataForSEOResponse;
          this.validateResponse(data);
          let result = data.items[0].page_as_markdown;
          return this.formatResponse(result);
        }
      } catch (error) {
        return this.formatErrorResponse(error);
      }
    }
  • Defines the input schema using Zod for parameters: url (required), and optional flags for JavaScript, custom JS, user agent, and accept 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"),
      };
    }
  • The `getTools()` method in `OnPageApiModule` instantiates the `ContentParsingTool` and registers it in a tool map using its name, description, params, and wrapped handler.
    getTools(): Record<string, ToolDefinition> {
      const tools = [
        new ContentParsingTool(this.dataForSEOClient),
        new InstantPagesTool(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),
        },
      }), {});
    }
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 states the tool returns structured content but does not cover critical aspects like rate limits, authentication needs, error handling, or performance implications (e.g., timeouts for JavaScript-heavy pages). This leaves significant gaps for an agent to use 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.

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 core functionality. It is front-loaded with the main purpose and avoids unnecessary details, though it could be slightly more concise by omitting 'This endpoint allows'.

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 web parsing (with parameters like JavaScript rendering) and no output schema or annotations, the description is insufficient. It lacks details on return format, error cases, or behavioral traits, making it incomplete for safe and effective use by an agent.

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, so the baseline is 3. The description adds no additional parameter semantics beyond what the schema provides (e.g., it doesn't explain how 'enable_javascript' affects parsing or what 'custom_js' can achieve), so it meets but does not exceed the minimum.

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: parsing page content to extract structured elements like links, anchors, headings, and text. It specifies the verb 'parsing' and resource 'content on any page', but does not differentiate from sibling tools, as none appear to be direct alternatives for content parsing.

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, prerequisites, or exclusions. It mentions 'any page you specify' but lacks context about limitations or ideal use cases compared to other tools in the list.

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/ravinwebsurgeon/seo-mcp'

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