Skip to main content
Glama
ravinwebsurgeon

DataForSEO MCP Server

content_analysis_phrase_trends

Analyze keyword citation trends over time to track phrase popularity and content mentions across websites.

Instructions

This endpoint will provide you with data on all citations of the target keyword for the indicated date range

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
keywordYestarget keyword Note: to match an exact phrase instead of a stand-alone keyword, use double quotes and backslashes;
keyword_fieldsNotarget keyword fields and target keywords use this parameter to filter the dataset by keywords that certain fields should contain; you can indicate several fields; Note: to match an exact phrase instead of a stand-alone keyword, use double quotes and backslashes; example: { "snippet": "\"logitech mouse\"", "main_title": "sale" }
page_typeNotarget page types
initial_dataset_filtersNoinitial dataset filtering parameters initial filtering parameters that apply to fields in the Search endpoint; you can add several filters at once (8 filters maximum); you should set a logical operator and, or between the conditions; the following operators are supported: regex, not_regex, <, <=, >, >=, =, <>, in, not_in, like,not_like, has, has_not, match, not_match you can use the % operator with like and not_like to match any string of zero or more characters; example: ["domain","<>", "logitech.com"] [["domain","<>","logitech.com"],"and",["content_info.connotation_types.negative",">",1000]] [["domain","<>","logitech.com"]], "and", [["content_info.connotation_types.negative",">",1000], "or", ["content_info.text_category","has",10994]]
date_fromYesstarting date of the time range date format: "yyyy-mm-dd"
date_toNoending date of the time range date format: "yyyy-mm-dd"
date_groupNodate grouping typemonth
internal_list_limitNomaximum number of elements within internal arrays you can use this field to limit the number of elements within the following arrays

Implementation Reference

  • The handle method that executes the tool logic: formats parameters and makes a POST request to DataForSEOClient at '/v3/content_analysis/phrase_trends/live', then validates and formats the response or error.
    async handle(params: any): Promise<any> {
      try {
        const response = await this.dataForSEOClient.makeRequest('/v3/content_analysis/phrase_trends/live', 'POST', [{
          keyword: params.keyword,
          keyword_fields: params.keyword_fields,
          page_type: params.page_type,
          initial_dataset_filters: this.formatFilters(params.initial_dataset_filters),
          date_from: params.date_from,
          date_to: params.date_to,
          date_group: params.date_group,
          internal_list_limit: params.internal_list_limit
        }]);
        return this.validateAndFormatResponse(response);
      } catch (error) {
        return this.formatErrorResponse(error);
      }
    }
  • Zod schema defining the input parameters for the tool, including keyword, filters, date range, and limits.
    getParams(): z.ZodRawShape {
      return {
        keyword: z.string().describe(`target keyword
          Note: to match an exact phrase instead of a stand-alone keyword, use double quotes and backslashes;`),
        keyword_fields: z.object({
          title: z.string().optional(),
          main_title: z.string().optional(),
          previous_title: z.string().optional(),
          snippet: z.string().optional()
        }).optional().describe(
          `target keyword fields and target keywords
          use this parameter to filter the dataset by keywords that certain fields should contain;
          you can indicate several fields;
          Note: to match an exact phrase instead of a stand-alone keyword, use double quotes and backslashes;
          example:
          {
            "snippet": "\\"logitech mouse\\"",
            "main_title": "sale"
          }`
        ),
        page_type: z.array(z.enum(['ecommerce','news','blogs', 'message-boards','organization'])).optional().describe(`target page types`),
        initial_dataset_filters: z.array(
          z.union([
            z.array(z.union([z.string(), z.number(), z.boolean()])).length(3),
            z.enum(["and", "or"])
          ])
        ).max(8).optional().describe(
          `initial dataset filtering parameters
          initial filtering parameters that apply to fields in the Search endpoint;
          you can add several filters at once (8 filters maximum);
          you should set a logical operator and, or between the conditions;
          the following operators are supported:
          regex, not_regex, <, <=, >, >=, =, <>, in, not_in, like,not_like, has, has_not, match, not_match
          you can use the % operator with like and not_like to match any string of zero or more characters;
          example:
          ["domain","<>", "logitech.com"]
          [["domain","<>","logitech.com"],"and",["content_info.connotation_types.negative",">",1000]]
    
          [["domain","<>","logitech.com"]],
          "and",
          [["content_info.connotation_types.negative",">",1000],
          "or",
          ["content_info.text_category","has",10994]]`
        ),
        date_from: z.string().describe(`starting date of the time range
          date format: "yyyy-mm-dd"`),
        date_to: z.string().describe(`ending date of the time range
          date format: "yyyy-mm-dd"`).optional(),
        date_group: z.enum(['day', 'week', 'month']).default('month').describe(`date grouping type`).optional(),
        internal_list_limit: z.number().min(1).max(20).default(1)
          .describe(
            `maximum number of elements within internal arrays
            you can use this field to limit the number of elements within the following arrays`)
          .optional(),
      };
    }
  • Registers the ContentAnalysisPhraseTrendsTool (line 11) along with other tools in the module's getTools() method, creating a map by tool name to definition including description, params, and wrapped handler.
    getTools(): Record<string, ToolDefinition> {
      const tools = [
        new ContentAnalysisSearchTool(this.dataForSEOClient),
        new ContentAnalysisSummaryTool(this.dataForSEOClient),
        new ContentAnalysisPhraseTrendsTool(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?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions the tool 'will provide you with data', implying a read-only operation, but doesn't cover critical aspects like rate limits, authentication needs, data format, pagination, or error handling. For a data retrieval tool with no annotation coverage, this leaves significant gaps in understanding how it behaves.

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 unnecessary details. It's appropriately sized for a tool where parameter details are handled in the schema, and every word earns its place by stating what the tool does.

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 tool's complexity (8 parameters, nested objects, no output schema) and lack of annotations, the description is incomplete. It doesn't explain the return data structure, potential limitations, or how to interpret results. For a data analysis tool with rich input schema but no output guidance, more context is needed to help the agent use it 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?

Schema description coverage is 100%, so the schema already documents all 8 parameters thoroughly. The description adds no additional parameter semantics beyond what's in the schema—it doesn't explain how parameters interact or provide usage examples. Baseline 3 is appropriate since the schema does the heavy lifting, but the description doesn't compensate with extra insights.

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: 'provide you with data on all citations of the target keyword for the indicated date range'. It specifies the verb ('provide data'), resource ('citations of the target keyword'), and scope ('date range'). However, it doesn't explicitly differentiate from sibling tools like 'content_analysis_search' or 'content_analysis_summary', which appear related but have different functions.

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 sibling tools, prerequisites, or contextual cues for selection. The agent must infer usage based on the purpose alone, which is insufficient for a complex tool with many parameters and siblings.

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