UNPKG

dataforseo-mcp-server

Version:

A Model Context Protocol (MCP) server for the DataForSEO API, enabling modular and extensible integration of DataForSEO endpoints with support for both HTTP and SSE transports.

47 lines (46 loc) 1.96 kB
import { z } from 'zod'; import { BaseTool } from '../../../../base.tool.js'; export class GoogleHistoricalDomainRankOverviewTool extends BaseTool { client; constructor(client) { super(client); this.client = client; } getName() { return 'dataforseo_labs_google_historical_rank_overview'; } getDescription() { return `This endpoint will provide you with historical data on rankings and traffic of the specified domain, such as domain ranking distribution in SERPs and estimated monthly traffic volume for both organic and paid results`; } getParams() { return { target: z.string().describe(`target domain`), 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`), ignore_synonyms: z.boolean().default(true).describe(`ignore highly similar keywords, if set to true, results will be more accurate`), include_clickstream_data: z.boolean().optional().default(false).describe(`Include or exclude data from clickstream-based metrics in the result`) }; } async handle(params) { try { const response = await this.client.makeRequest('/v3/dataforseo_labs/google/historical_rank_overview/live', 'POST', [{ target: params.target, location_name: params.location_name, language_code: params.language_code, ignore_synonyms: params.ignore_synonyms, include_clickstream_data: params.include_clickstream_data }]); return this.validateAndFormatResponse(response); } catch (error) { return this.formatErrorResponse(error); } } }