Skip to main content
Glama
ravinwebsurgeon

DataForSEO MCP Server

dataforseo_labs_google_historical_serp

Analyze Google SERP ranking changes over time for keywords and locations to track SEO performance and featured snippet history.

Instructions

This endpoint will provide you with Google SERPs collected within the specified time frame. You will also receive a complete overview of featured snippets and other extra elements that were present within the specified dates. The data will allow you to analyze the dynamics of keyword rankings over time for the specified keyword and location.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
keywordYestarget keyword
location_nameNofull name of the location required field only in format "Country" (not "City" or "Region") example: 'United Kingdom', 'United States', 'Canada'United States
language_codeNolanguage code required field example: enen

Implementation Reference

  • The handle method that executes the tool logic: makes API request to DataForSEO Labs Google historical SERPs endpoint, processes and formats the response.
    async handle(params: any): Promise<any> {
      try {
        const response = await this.client.makeRequest('/v3/dataforseo_labs/google/historical_serps/live', 'POST', [{
          keyword: params.keyword,
          location_name: params.location_name,
          language_code: params.language_code
        }]);
    
        console.error(JSON.stringify(response));
        if(defaultGlobalToolConfig.fullResponse || this.supportOnlyFullResponse()){
          return this.validateAndFormatResponse(response);
        }
        else {
          let data = response as DataForSEOResponse;
          this.validateResponse(data);
          let result = data.items;
          let filteredResult = result.map(item => this.filterResponseFields(item, [     
            "datetime",
            "items.type",
            "items.title",
            "items.domain",
            "items.rank_absolute"]));
            console.error(JSON.stringify(filteredResult));
          return this.formatResponse(filteredResult);
        }
        } catch (error) {
        return this.formatErrorResponse(error);
      }
    }
  • Zod schema defining the input parameters: keyword, location_name, language_code.
      getParams(): z.ZodRawShape {
        return {
          keyword: z.string().describe(`target keyword`),
          location_name: z.string().default("United States").describe(`full name of the location
    required field
    in format "Country"
    example:
    United Kingdom`),
          language_code: z.string().default("en").describe(
            `language code
            required field
            example:
            en`)
        };
      }
  • Registers the tool by instantiating GoogleHistoricalSERP and including it in the tools array, which is then mapped to tool definitions with name, description, params, and handler.
    getTools(): Record<string, ToolDefinition> {
      const tools = [
        new GoogleRankedKeywordsTool(this.dataForSEOClient),
        new GoogleDomainCompetitorsTool(this.dataForSEOClient),
        new GoogleDomainRankOverviewTool(this.dataForSEOClient),
        new GoogleKeywordsIdeasTool(this.dataForSEOClient),
        new GoogleRelatedKeywordsTool(this.dataForSEOClient),
        new GoogleKeywordsSuggestionsTool(this.dataForSEOClient),
        new GoogleHistoricalSERP(this.dataForSEOClient),
        new GoogleSERPCompetitorsTool(this.dataForSEOClient),
        new GoogleBulkKeywordDifficultyTool(this.dataForSEOClient),
        new GoogleSubdomainsTool(this.dataForSEOClient),
        new GoogleKeywordOverviewTool(this.dataForSEOClient),
        new GoogleTopSearchesTool(this.dataForSEOClient),
        new GoogleSearchIntentTool(this.dataForSEOClient),
        new GoogleKeywordsForSiteTool(this.dataForSEOClient),
        new GoogleDomainIntersectionsTool(this.dataForSEOClient),
        new GoogleHistoricalDomainRankOverviewTool(this.dataForSEOClient),
        new GooglePageIntersectionsTool(this.dataForSEOClient),
        new GoogleBulkTrafficEstimationTool(this.dataForSEOClient),
        new DataForSeoLabsFilterTool(this.dataForSEOClient),
        new GoogleHistoricalKeywordDataTool(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 full burden for behavioral disclosure. It describes the data returned (SERPs, featured snippets, ranking dynamics) but doesn't mention important behavioral aspects like rate limits, authentication requirements, pagination, data freshness, or whether this is a read-only operation. The description is insufficient for a mutation-sensitive agent to assess risk.

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 efficiently structured in three sentences that progressively explain what data is provided, what extra elements are included, and how the data can be used. There's no wasted text, though it could be slightly more front-loaded with the core purpose.

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 3 parameters, no annotations, and no output schema, the description is incomplete. It doesn't explain what the output looks like (structure, format), doesn't address behavioral concerns like rate limits or authentication, and provides minimal guidance on usage versus alternatives. The agent would struggle to use this tool effectively without additional context.

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 fully documents all three parameters. The description adds marginal value by mentioning 'specified time frame' (though time parameters aren't in the schema) and reinforcing keyword/location focus, but doesn't provide additional syntax, format, or constraint details beyond what the schema provides.

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 provides Google SERPs collected within a specified time frame with analysis of featured snippets and ranking dynamics. It specifies the verb ('provide', 'analyze') and resource ('Google SERPs'), but doesn't explicitly differentiate from sibling tools like 'dataforseo_labs_google_historical_keyword_data' or 'dataforseo_labs_google_historical_rank_overview' that might offer similar historical data.

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 mentions analyzing keyword ranking dynamics over time for specific keywords and locations, which implies usage context. However, it provides no explicit guidance on when to use this tool versus alternatives like 'dataforseo_labs_google_historical_keyword_data' or 'serp_organic_live_advanced', nor does it mention prerequisites or exclusions.

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