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.

50 lines (49 loc) 2.11 kB
import { z } from 'zod'; import { BaseTool } from '../../../../base.tool.js'; export class GoogleBulkTrafficEstimationTool extends BaseTool { client; constructor(client) { super(client); this.client = client; } getName() { return 'dataforseo_labs_bulk_traffic_estimation'; } getDescription() { return `This endpoint will provide you with estimated monthly traffic volumes for up to 1,000 domains, subdomains, or webpages. Along with organic search traffic estimations, you will also get separate values for paid search, featured snippet, and local pack results.`; } getParams() { return { targets: z.array(z.string()).describe(`target domains, subdomains, and webpages. you can specify domains, subdomains, and webpages in this field; domains and subdomains should be specified without https:// and www.; pages should be specified with absolute URL, including https:// and www.; you can set up to 1000 domains, subdomains or webpages`), 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`), }; } async handle(params) { try { const response = await this.client.makeRequest('/v3/dataforseo_labs/google/bulk_traffic_estimation/live', 'POST', [{ targets: params.targets, location_name: params.location_name, language_code: params.language_code, item_types: ['organic'], ignore_synonyms: params.ignore_synonyms }]); return this.validateAndFormatResponse(response); } catch (error) { return this.formatErrorResponse(error); } } }