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.
56 lines (55 loc) • 2.25 kB
JavaScript
import { z } from 'zod';
import { BaseTool } from '../../base.tool.js';
export class BacklinksBulkRanksTool extends BaseTool {
client;
constructor(client) {
super(client);
this.client = client;
}
getName() {
return 'backlinks_bulk_ranks';
}
getDescription() {
return "This endpoint will provide you with rank scores of the domains, subdomains, and pages specified in the targets array. The score is based on the number of referring domains pointing to the specified domains, subdomains, or pages. The rank values represent real-time data for the date of the request and range from 0 (no backlinks detected) to 1,000 (highest rank). A similar scoring system is used in Google’s Page Rank algorithm";
}
getParams() {
return {
targets: z.array(z.string()).describe(`domains, subdomains or webpages to get rank for
required field
you can set up to 1000 domains, subdomains or webpages
the domain or subdomain should be specified without https:// and www.
the page should be specified with absolute URL (including http:// or https://)
example:
"targets": [
"forbes.com",
"cnn.com",
"bbc.com",
"yelp.com",
"https://www.apple.com/iphone/",
"https://ahrefs.com/blog/",
"ibm.com",
"https://variety.com/",
"https://stackoverflow.com/",
"www.trustpilot.com"
]`),
rank_scale: z.string().optional().describe(`defines the scale used for calculating and displaying the rank, domain_from_rank, and page_from_rank values
optional field
you can use this parameter to choose whether rank values are presented on a 0–100 or 0–1000 scale
possible values:
one_hundred — rank values are displayed on a 0–100 scale
one_thousand — rank values are displayed on a 0–1000 scale`).default('one_thousand')
};
}
async handle(params) {
try {
const response = await this.client.makeRequest('/v3/backlinks/bulk_ranks/live', 'POST', [{
targets: params.targets,
rank_scale: params.rank_scale
}]);
return this.validateAndFormatResponse(response);
}
catch (error) {
return this.formatErrorResponse(error);
}
}
}