@serpstat/serpstat-mcp-server 1.0.5 → 1.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/README.md +30 -21
- package/dist/handlers/backlinks_tools.d.ts +48 -0
- package/dist/handlers/backlinks_tools.d.ts.map +1 -1
- package/dist/handlers/backlinks_tools.js +436 -31
- package/dist/handlers/backlinks_tools.js.map +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +7 -1
- package/dist/server.js.map +1 -1
- package/dist/services/backlinks_tools.d.ts +8 -2
- package/dist/services/backlinks_tools.d.ts.map +1 -1
- package/dist/services/backlinks_tools.js +141 -0
- package/dist/services/backlinks_tools.js.map +1 -1
- package/dist/transports/base.d.ts +18 -0
- package/dist/transports/base.d.ts.map +1 -0
- package/dist/transports/base.js +11 -0
- package/dist/transports/base.js.map +1 -0
- package/dist/transports/http.d.ts +21 -0
- package/dist/transports/http.d.ts.map +1 -0
- package/dist/transports/http.js +283 -0
- package/dist/transports/http.js.map +1 -0
- package/dist/transports/stdio.d.ts +8 -0
- package/dist/transports/stdio.d.ts.map +1 -0
- package/dist/transports/stdio.js +25 -0
- package/dist/transports/stdio.js.map +1 -0
- package/dist/types/serpstat.d.ts +72 -0
- package/dist/types/serpstat.d.ts.map +1 -1
- package/dist/utils/constants.d.ts +13 -0
- package/dist/utils/constants.d.ts.map +1 -1
- package/dist/utils/constants.js +48 -2
- package/dist/utils/constants.js.map +1 -1
- package/dist/utils/validation.d.ts +301 -4
- package/dist/utils/validation.d.ts.map +1 -1
- package/dist/utils/validation.js +70 -1
- package/dist/utils/validation.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,9 +1,24 @@
|
|
|
1
1
|
# Changelog
|
|
2
|
+
## [1.0.7] - 2025-09-30
|
|
3
|
+
|
|
4
|
+
### Fixed
|
|
5
|
+
- **Gemini API Compatibility**: Removed `complexFilter` parameter from backlinks methods (get_lost_backlinks, get_active_backlinks, get_threat_backlinks, etc.) to resolve JSON schema nesting depth error
|
|
6
|
+
- Standard filtering via `sort`, `order`, `size` fully supported
|
|
7
|
+
- Breaking change: users with `complexFilter` usage must migrate to client-side filtering
|
|
8
|
+
|
|
9
|
+
## [1.0.6] - 2025-09-29
|
|
10
|
+
- Added `get_top_pages_by_backlinks` method to retrieve a list of top pages by backlinks with various filtering and sorting parameters
|
|
11
|
+
- Added `get_backlinks_intersection` method to get backlinks from domains that link to multiple analyzed sites simultaneously, useful for competitive backlink analysis and identifying potential link sources
|
|
12
|
+
- Added `get_active_outlinks` method to get active outbound links from a domain or URL, including target URLs, anchor text, link attributes (nofollow/dofollow), link types, and discovery dates for analyzing linking strategies and partnership opportunities
|
|
13
|
+
- Added `get_active_outlink_domains` method to get external domains that receive outbound links from the analyzed domain, revealing partnership networks, referenced sources, and linking patterns for identifying collaboration opportunities
|
|
14
|
+
- Added `get_threat_backlinks` method to identify malicious backlinks pointing to the analyzed domain, including links from sites flagged for threats like social engineering, malware, or unwanted software, with detailed threat classification and platform information
|
|
15
|
+
|
|
2
16
|
|
|
3
17
|
## [1.0.5] - 2025-09-18
|
|
4
18
|
- Added `get_active_backlinks` method to retrieve a list of active backlinks showing linking pages, target pages, link attributes, link types, external links count, anchor text, and discovery dates for domain or URL analysis
|
|
5
19
|
- Added `get_referring_domains` method to retrieve a list of referring domains that link to the analyzed site with domain rank metrics, referring pages count, and filtering options for comprehensive backlink analysis
|
|
6
20
|
- Added `get_lost_backlinks` method to retrieve a list of lost backlinks showing linking pages, target pages, link attributes, and deletion dates for domain or URL analysis
|
|
21
|
+
- Added `get_top10_anchors` method to retrieve TOP-10 anchors with the number of backlinks and referring domains for domain analysis
|
|
7
22
|
|
|
8
23
|
## [1.0.4] - 2025-09-16
|
|
9
24
|
### Added
|
package/README.md
CHANGED
|
@@ -136,30 +136,39 @@ After installation and configuration in Claude Desktop, you can ask Claude:
|
|
|
136
136
|
- "Get active backlinks for **domain.com** showing linking pages and target URLs"
|
|
137
137
|
- "Get referring domains for **domain.com** with domain authority metrics"
|
|
138
138
|
- "Get lost backlinks for **domain.com** showing removed links and deletion dates"
|
|
139
|
+
- "Get top 10 anchors for **domain.com** with backlink counts and referring domains"
|
|
140
|
+
- "Get backlinks intersection for **domain.com** vs **competitor1.com** and **competitor2.com** showing shared referring domains"
|
|
141
|
+
- "Get threat backlinks for **domain.com** showing malicious links from sites flagged for security threats"
|
|
139
142
|
|
|
140
143
|
## MCP Tools
|
|
141
144
|
|
|
142
|
-
| Tool Name
|
|
143
|
-
|
|
144
|
-
| get_domains_info
|
|
145
|
-
| get_domain_competitors
|
|
146
|
-
| get_domain_keywords
|
|
147
|
-
| get_domain_urls
|
|
148
|
-
| get_domain_regions_count
|
|
149
|
-
| get_domain_uniq_keywords
|
|
150
|
-
| get_keywords
|
|
151
|
-
| get_keyword_suggestions
|
|
152
|
-
| get_keywords_info
|
|
153
|
-
| get_keyword_full_top
|
|
154
|
-
| get_keyword_top_urls
|
|
155
|
-
| get_keyword_competitors
|
|
156
|
-
| get_keyword_top
|
|
157
|
-
| get_backlinks_summary
|
|
158
|
-
| get_anchors
|
|
159
|
-
| get_active_backlinks
|
|
160
|
-
| get_referring_domains
|
|
161
|
-
| get_lost_backlinks
|
|
162
|
-
|
|
|
145
|
+
| Tool Name | Description | Key Parameters |
|
|
146
|
+
|----------------------------|----------------------------------------------------------------------------------------------------------------|---------------------------------|
|
|
147
|
+
| get_domains_info | Get SEO information for multiple domains | domains, se, filters |
|
|
148
|
+
| get_domain_competitors | Get list of competitor domains | domain, se, size, filters |
|
|
149
|
+
| get_domain_keywords | Get keywords that domain ranks for | domain, se, page, size |
|
|
150
|
+
| get_domain_urls | Get URLs within a domain and their keyword counts | domain, se, page, size |
|
|
151
|
+
| get_domain_regions_count | Get keyword count by region for a domain | domain, sort, order |
|
|
152
|
+
| get_domain_uniq_keywords | Get unique keywords for two domains not ranked by a third domain | se, domains, minusDomain |
|
|
153
|
+
| get_keywords | Get related organic keywords for a given keyword | keyword, se, filters |
|
|
154
|
+
| get_keyword_suggestions | Get search suggestions for a keyword using full-text search with geographic names info | keyword, se, filters |
|
|
155
|
+
| get_keywords_info | Get keyword overview with volume, CPC, competition, difficulty, and SERP features | keywords, se, withIntents |
|
|
156
|
+
| get_keyword_full_top | Get Google's top-100 search results for analyzed keywords | keyword, se, size |
|
|
157
|
+
| get_keyword_top_urls | Get website pages that rank for the largest amount of analyzed keyword variations with highest traffic | keyword, se, page, page_size |
|
|
158
|
+
| get_keyword_competitors | Get domains that rank for the given keyword in Google top-20 results with competitor analysis | keyword, se, filters, sort |
|
|
159
|
+
| get_keyword_top | Get Google's top-100 search results for the analyzed keyword with position, URL, domain and SERP features | keyword, se, filters, size |
|
|
160
|
+
| get_backlinks_summary | Get comprehensive backlinks summary with referring domains, quality metrics, and changes | domain, subdomain |
|
|
161
|
+
| get_anchors | Get anchor text analysis for backlinks with metrics on referring domains, total backlinks, and nofollow counts | query, searchType, anchor, sort |
|
|
162
|
+
| get_active_backlinks | Get a list of active backlinks showing linking pages, target pages, link attributes, and discovery dates | query, searchType, sort, page |
|
|
163
|
+
| get_referring_domains | Get a list of referring domains with domain rank metrics, referring pages count, and filtering options | query, searchType, sort, page |
|
|
164
|
+
| get_lost_backlinks | Get a list of lost backlinks showing linking pages, target pages, link attributes, and deletion dates | query, searchType, sort, page |
|
|
165
|
+
| get_top_pages_by_backlinks | Get a list of top pages by backlinks with various filtering and sorting parameters | query, searchType, sort, size |
|
|
166
|
+
| get_top10_anchors | Get TOP-10 anchors with the number of backlinks and referring domains for domain analysis | query, searchType |
|
|
167
|
+
| get_backlinks_intersection | Get backlinks from domains that link to multiple analyzed sites simultaneously for competitive analysis | query, intersect, sort, page |
|
|
168
|
+
| get_active_outlinks | Get active outbound links from a domain or URL with target URLs, anchor text, and link attributes | query, searchType, sort, filters |
|
|
169
|
+
| get_active_outlink_domains | Get external domains that receive outbound links from analyzed domain revealing partnership networks | query, searchType, sort, filters |
|
|
170
|
+
| get_threat_backlinks | Get malicious backlinks pointing to analyzed domain from sites flagged for security threats | query, searchType, sort, filters |
|
|
171
|
+
| get_related_keywords | Get semantically related keywords with frequency, CPC, competition, and difficulty data | keyword, se, filters, sort |
|
|
163
172
|
|
|
164
173
|
### Search Engines (se parameter)
|
|
165
174
|
|
|
@@ -40,4 +40,52 @@ export declare class GetLostBacklinksHandler extends BaseHandler {
|
|
|
40
40
|
getInputSchema(): Record<string, any>;
|
|
41
41
|
handle(call: MCPToolCall): Promise<MCPToolResponse>;
|
|
42
42
|
}
|
|
43
|
+
export declare class GetTopAnchorsHandler extends BaseHandler {
|
|
44
|
+
private backlinksService;
|
|
45
|
+
constructor();
|
|
46
|
+
getName(): string;
|
|
47
|
+
getDescription(): string;
|
|
48
|
+
getInputSchema(): Record<string, any>;
|
|
49
|
+
handle(call: MCPToolCall): Promise<MCPToolResponse>;
|
|
50
|
+
}
|
|
51
|
+
export declare class GetTopPagesByBacklinksHandler extends BaseHandler {
|
|
52
|
+
private backlinksService;
|
|
53
|
+
constructor();
|
|
54
|
+
getName(): string;
|
|
55
|
+
getDescription(): string;
|
|
56
|
+
getInputSchema(): Record<string, any>;
|
|
57
|
+
handle(call: MCPToolCall): Promise<MCPToolResponse>;
|
|
58
|
+
}
|
|
59
|
+
export declare class GetBacklinksIntersectionHandler extends BaseHandler {
|
|
60
|
+
private backlinksService;
|
|
61
|
+
constructor();
|
|
62
|
+
getName(): string;
|
|
63
|
+
getDescription(): string;
|
|
64
|
+
getInputSchema(): Record<string, any>;
|
|
65
|
+
handle(call: MCPToolCall): Promise<MCPToolResponse>;
|
|
66
|
+
}
|
|
67
|
+
export declare class GetActiveOutlinksHandler extends BaseHandler {
|
|
68
|
+
private backlinksService;
|
|
69
|
+
constructor();
|
|
70
|
+
getName(): string;
|
|
71
|
+
getDescription(): string;
|
|
72
|
+
getInputSchema(): Record<string, any>;
|
|
73
|
+
handle(call: MCPToolCall): Promise<MCPToolResponse>;
|
|
74
|
+
}
|
|
75
|
+
export declare class GetActiveOutlinkDomainsHandler extends BaseHandler {
|
|
76
|
+
private backlinksService;
|
|
77
|
+
constructor();
|
|
78
|
+
getName(): string;
|
|
79
|
+
getDescription(): string;
|
|
80
|
+
getInputSchema(): Record<string, any>;
|
|
81
|
+
handle(call: MCPToolCall): Promise<MCPToolResponse>;
|
|
82
|
+
}
|
|
83
|
+
export declare class GetThreatBacklinksHandler extends BaseHandler {
|
|
84
|
+
private backlinksService;
|
|
85
|
+
constructor();
|
|
86
|
+
getName(): string;
|
|
87
|
+
getDescription(): string;
|
|
88
|
+
getInputSchema(): Record<string, any>;
|
|
89
|
+
handle(call: MCPToolCall): Promise<MCPToolResponse>;
|
|
90
|
+
}
|
|
43
91
|
//# sourceMappingURL=backlinks_tools.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"backlinks_tools.d.ts","sourceRoot":"","sources":["../../src/handlers/backlinks_tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAExC,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"backlinks_tools.d.ts","sourceRoot":"","sources":["../../src/handlers/backlinks_tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAExC,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAS/D,qBAAa,uBAAwB,SAAQ,WAAW;IACpD,OAAO,CAAC,gBAAgB,CAAmB;;IAQ3C,OAAO,IAAI,MAAM;IAIjB,cAAc,IAAI,MAAM;IAIxB,cAAc,IAAI,MAAM;IAuBlB,MAAM,CAAC,IAAI,EAAE,WAAW,GAAG,OAAO,CAAC,eAAe,CAAC;CAY5D;AAED,qBAAa,iBAAkB,SAAQ,WAAW;IAC9C,OAAO,CAAC,gBAAgB,CAAmB;;I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etLostBacklinksHandler = exports.GetReferringDomainsHandler = exports.GetActiveBacklinksHandler = exports.GetAnchorsHandler = exports.BacklinksSummaryHandler = void 0;
|
|
3
|
+
exports.GetThreatBacklinksHandler = exports.GetActiveOutlinkDomainsHandler = exports.GetActiveOutlinksHandler = exports.GetBacklinksIntersectionHandler = exports.GetTopPagesByBacklinksHandler = exports.GetTopAnchorsHandler = exports.GetLostBacklinksHandler = exports.GetReferringDomainsHandler = exports.GetActiveBacklinksHandler = exports.GetAnchorsHandler = exports.BacklinksSummaryHandler = void 0;
|
|
4
4
|
const base_js_1 = require("./base.js");
|
|
5
5
|
const backlinks_tools_js_1 = require("../services/backlinks_tools.js");
|
|
6
6
|
const validation_js_1 = require("../utils/validation.js");
|
|
@@ -306,7 +306,7 @@ class GetLostBacklinksHandler extends base_js_1.BaseHandler {
|
|
|
306
306
|
return 'get_lost_backlinks';
|
|
307
307
|
}
|
|
308
308
|
getDescription() {
|
|
309
|
-
return 'Get a list of lost backlinks showing linking pages, target pages, link attributes, and deletion dates for domain or URL analysis';
|
|
309
|
+
return 'Get a list of lost backlinks showing linking pages, target pages, link attributes, and deletion dates for domain or URL analysis, **use sort by check desc** to get recently lost backlinks';
|
|
310
310
|
}
|
|
311
311
|
getInputSchema() {
|
|
312
312
|
return {
|
|
@@ -335,35 +335,6 @@ class GetLostBacklinksHandler extends base_js_1.BaseHandler {
|
|
|
335
335
|
enum: constants_js_1.SORT_ORDER,
|
|
336
336
|
description: "Sort order: asc or desc"
|
|
337
337
|
},
|
|
338
|
-
complexFilter: {
|
|
339
|
-
type: "array",
|
|
340
|
-
items: {
|
|
341
|
-
type: "array",
|
|
342
|
-
items: {
|
|
343
|
-
type: "object",
|
|
344
|
-
properties: {
|
|
345
|
-
name: {
|
|
346
|
-
type: "string",
|
|
347
|
-
enum: constants_js_1.LOST_BACKLINKS_COMPLEX_FILTER_FIELDS
|
|
348
|
-
},
|
|
349
|
-
operator: {
|
|
350
|
-
type: "string",
|
|
351
|
-
enum: constants_js_1.COMPLEX_FILTER_COMPARE_TYPES
|
|
352
|
-
},
|
|
353
|
-
value: {
|
|
354
|
-
oneOf: [
|
|
355
|
-
{ type: "string" },
|
|
356
|
-
{ type: "number" },
|
|
357
|
-
{ type: "array", items: { oneOf: [{ type: "string" }, { type: "number" }] } }
|
|
358
|
-
]
|
|
359
|
-
}
|
|
360
|
-
},
|
|
361
|
-
required: ["name", "operator", "value"],
|
|
362
|
-
additionalProperties: false
|
|
363
|
-
}
|
|
364
|
-
},
|
|
365
|
-
description: "Complex filters for advanced filtering"
|
|
366
|
-
},
|
|
367
338
|
additionalFilters: {
|
|
368
339
|
type: "array",
|
|
369
340
|
items: {
|
|
@@ -405,4 +376,438 @@ class GetLostBacklinksHandler extends base_js_1.BaseHandler {
|
|
|
405
376
|
}
|
|
406
377
|
}
|
|
407
378
|
exports.GetLostBacklinksHandler = GetLostBacklinksHandler;
|
|
379
|
+
class GetTopAnchorsHandler extends base_js_1.BaseHandler {
|
|
380
|
+
backlinksService;
|
|
381
|
+
constructor() {
|
|
382
|
+
super();
|
|
383
|
+
const config = (0, config_js_1.loadConfig)();
|
|
384
|
+
this.backlinksService = new backlinks_tools_js_1.BacklinksService(config);
|
|
385
|
+
}
|
|
386
|
+
getName() {
|
|
387
|
+
return 'get_top10_anchors';
|
|
388
|
+
}
|
|
389
|
+
getDescription() {
|
|
390
|
+
return 'Get TOP-10 anchors with the number of backlinks and referring domains for domain analysis, use this method is you need a fast brief way to get info about top 10 anchors';
|
|
391
|
+
}
|
|
392
|
+
getInputSchema() {
|
|
393
|
+
return {
|
|
394
|
+
type: "object",
|
|
395
|
+
properties: {
|
|
396
|
+
query: {
|
|
397
|
+
type: "string",
|
|
398
|
+
minLength: constants_js_1.MIN_DOMAIN_LENGTH,
|
|
399
|
+
maxLength: constants_js_1.MAX_DOMAIN_LENGTH,
|
|
400
|
+
description: "Domain name to analyze"
|
|
401
|
+
},
|
|
402
|
+
searchType: {
|
|
403
|
+
type: "string",
|
|
404
|
+
enum: constants_js_1.SEARCH_TYPES,
|
|
405
|
+
default: "domain",
|
|
406
|
+
description: "Type of search: domain or domain_with_subdomains"
|
|
407
|
+
}
|
|
408
|
+
},
|
|
409
|
+
required: ["query"],
|
|
410
|
+
additionalProperties: false
|
|
411
|
+
};
|
|
412
|
+
}
|
|
413
|
+
async handle(call) {
|
|
414
|
+
try {
|
|
415
|
+
const params = validation_js_1.getTopAnchorsSchema.parse(call.arguments);
|
|
416
|
+
const result = await this.backlinksService.getTopAnchors(params);
|
|
417
|
+
return this.createSuccessResponse(result);
|
|
418
|
+
}
|
|
419
|
+
catch (error) {
|
|
420
|
+
if (error instanceof zod_1.z.ZodError) {
|
|
421
|
+
return this.createErrorResponse(new Error('Invalid parameters: ' + error.errors.map(e => e.path.join('.') + ': ' + e.message).join(', ')));
|
|
422
|
+
}
|
|
423
|
+
return this.createErrorResponse(error);
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
exports.GetTopAnchorsHandler = GetTopAnchorsHandler;
|
|
428
|
+
class GetTopPagesByBacklinksHandler extends base_js_1.BaseHandler {
|
|
429
|
+
backlinksService;
|
|
430
|
+
constructor() {
|
|
431
|
+
super();
|
|
432
|
+
const config = (0, config_js_1.loadConfig)();
|
|
433
|
+
this.backlinksService = new backlinks_tools_js_1.BacklinksService(config);
|
|
434
|
+
}
|
|
435
|
+
getName() {
|
|
436
|
+
return 'get_top_pages_by_backlinks';
|
|
437
|
+
}
|
|
438
|
+
getDescription() {
|
|
439
|
+
return 'Get leading pages by backlinks using Serpstat API. Returns pages with the highest number of referring pages, domains, and IP addresses for comprehensive backlink analysis.';
|
|
440
|
+
}
|
|
441
|
+
getInputSchema() {
|
|
442
|
+
return {
|
|
443
|
+
type: "object",
|
|
444
|
+
properties: {
|
|
445
|
+
query: {
|
|
446
|
+
type: "string",
|
|
447
|
+
minLength: constants_js_1.MIN_DOMAIN_LENGTH,
|
|
448
|
+
maxLength: constants_js_1.MAX_DOMAIN_LENGTH,
|
|
449
|
+
description: "Domain name to analyze"
|
|
450
|
+
},
|
|
451
|
+
searchType: {
|
|
452
|
+
type: "string",
|
|
453
|
+
enum: constants_js_1.SEARCH_TYPES,
|
|
454
|
+
default: "domain",
|
|
455
|
+
description: "Type of search: domain or domain_with_subdomains"
|
|
456
|
+
},
|
|
457
|
+
sort: {
|
|
458
|
+
type: "string",
|
|
459
|
+
enum: constants_js_1.TOP_PAGES_SORT_FIELDS,
|
|
460
|
+
default: "lastupdate",
|
|
461
|
+
description: "Field to sort results by"
|
|
462
|
+
},
|
|
463
|
+
order: {
|
|
464
|
+
type: "string",
|
|
465
|
+
enum: constants_js_1.SORT_ORDER,
|
|
466
|
+
description: "Sort order: asc or desc"
|
|
467
|
+
},
|
|
468
|
+
page: {
|
|
469
|
+
type: "integer",
|
|
470
|
+
minimum: constants_js_1.MIN_PAGE,
|
|
471
|
+
default: 1,
|
|
472
|
+
description: "Page number for pagination"
|
|
473
|
+
},
|
|
474
|
+
size: {
|
|
475
|
+
type: "integer",
|
|
476
|
+
minimum: 1,
|
|
477
|
+
maximum: constants_js_1.MAX_PAGE_SIZE,
|
|
478
|
+
default: constants_js_1.DEFAULT_PAGE_SIZE,
|
|
479
|
+
description: "Number of results per page"
|
|
480
|
+
}
|
|
481
|
+
},
|
|
482
|
+
required: ["query"],
|
|
483
|
+
additionalProperties: false
|
|
484
|
+
};
|
|
485
|
+
}
|
|
486
|
+
async handle(call) {
|
|
487
|
+
try {
|
|
488
|
+
const params = validation_js_1.getTopPagesByBacklinksSchema.parse(call.arguments);
|
|
489
|
+
const result = await this.backlinksService.getTopPagesByBacklinks(params);
|
|
490
|
+
return this.createSuccessResponse(result);
|
|
491
|
+
}
|
|
492
|
+
catch (error) {
|
|
493
|
+
if (error instanceof zod_1.z.ZodError) {
|
|
494
|
+
return this.createErrorResponse(new Error('Invalid parameters: ' + error.errors.map(e => e.path.join('.') + ': ' + e.message).join(', ')));
|
|
495
|
+
}
|
|
496
|
+
return this.createErrorResponse(error);
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
}
|
|
500
|
+
exports.GetTopPagesByBacklinksHandler = GetTopPagesByBacklinksHandler;
|
|
501
|
+
class GetBacklinksIntersectionHandler extends base_js_1.BaseHandler {
|
|
502
|
+
backlinksService;
|
|
503
|
+
constructor() {
|
|
504
|
+
super();
|
|
505
|
+
const config = (0, config_js_1.loadConfig)();
|
|
506
|
+
this.backlinksService = new backlinks_tools_js_1.BacklinksService(config);
|
|
507
|
+
}
|
|
508
|
+
getName() {
|
|
509
|
+
return 'get_backlinks_intersection';
|
|
510
|
+
}
|
|
511
|
+
getDescription() {
|
|
512
|
+
return 'Get backlinks from domains that link to multiple analyzed sites simultaneously. This method reveals shared referring domains between your target domain and competitors, useful for competitive backlink analysis and identifying potential link sources. Returns intersection data showing which donors link to multiple domains in your analysis set, including link metrics, anchor texts, and domain authority scores.';
|
|
513
|
+
}
|
|
514
|
+
getInputSchema() {
|
|
515
|
+
return {
|
|
516
|
+
type: "object",
|
|
517
|
+
properties: {
|
|
518
|
+
query: {
|
|
519
|
+
type: "string",
|
|
520
|
+
minLength: constants_js_1.MIN_DOMAIN_LENGTH,
|
|
521
|
+
maxLength: constants_js_1.MAX_DOMAIN_LENGTH,
|
|
522
|
+
description: "Main domain to analyze for backlinks intersection"
|
|
523
|
+
},
|
|
524
|
+
intersect: {
|
|
525
|
+
type: "array",
|
|
526
|
+
items: {
|
|
527
|
+
type: "string",
|
|
528
|
+
minLength: constants_js_1.MIN_DOMAIN_LENGTH,
|
|
529
|
+
maxLength: constants_js_1.MAX_DOMAIN_LENGTH
|
|
530
|
+
},
|
|
531
|
+
minItems: 1,
|
|
532
|
+
maxItems: constants_js_1.MAX_INTERSECT_DOMAINS,
|
|
533
|
+
description: "Array of competitor domains for intersection analysis"
|
|
534
|
+
},
|
|
535
|
+
sort: {
|
|
536
|
+
type: "string",
|
|
537
|
+
enum: constants_js_1.BACKLINKS_INTERSECTION_SORT_FIELDS,
|
|
538
|
+
default: "domain_rank",
|
|
539
|
+
description: "Field to sort results by (domain_rank, links_count1, links_count2, links_count3)"
|
|
540
|
+
},
|
|
541
|
+
order: {
|
|
542
|
+
type: "string",
|
|
543
|
+
enum: constants_js_1.SORT_ORDER,
|
|
544
|
+
default: "desc",
|
|
545
|
+
description: "Sort order: asc or desc"
|
|
546
|
+
},
|
|
547
|
+
page: {
|
|
548
|
+
type: "integer",
|
|
549
|
+
minimum: constants_js_1.MIN_PAGE,
|
|
550
|
+
default: 1,
|
|
551
|
+
description: "Page number for pagination"
|
|
552
|
+
},
|
|
553
|
+
size: {
|
|
554
|
+
type: "integer",
|
|
555
|
+
minimum: 1,
|
|
556
|
+
maximum: constants_js_1.MAX_PAGE_SIZE,
|
|
557
|
+
default: constants_js_1.DEFAULT_PAGE_SIZE,
|
|
558
|
+
description: "Number of results per page"
|
|
559
|
+
}
|
|
560
|
+
},
|
|
561
|
+
required: ["query", "intersect"],
|
|
562
|
+
additionalProperties: false
|
|
563
|
+
};
|
|
564
|
+
}
|
|
565
|
+
async handle(call) {
|
|
566
|
+
try {
|
|
567
|
+
const params = validation_js_1.getBacklinksIntersectionSchema.parse(call.arguments);
|
|
568
|
+
const result = await this.backlinksService.getBacklinksIntersection(params);
|
|
569
|
+
return this.createSuccessResponse(result);
|
|
570
|
+
}
|
|
571
|
+
catch (error) {
|
|
572
|
+
if (error instanceof zod_1.z.ZodError) {
|
|
573
|
+
return this.createErrorResponse(new Error('Invalid parameters: ' + error.errors.map(e => e.path.join('.') + ': ' + e.message).join(', ')));
|
|
574
|
+
}
|
|
575
|
+
return this.createErrorResponse(error);
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
exports.GetBacklinksIntersectionHandler = GetBacklinksIntersectionHandler;
|
|
580
|
+
class GetActiveOutlinksHandler extends base_js_1.BaseHandler {
|
|
581
|
+
backlinksService;
|
|
582
|
+
constructor() {
|
|
583
|
+
super();
|
|
584
|
+
const config = (0, config_js_1.loadConfig)();
|
|
585
|
+
this.backlinksService = new backlinks_tools_js_1.BacklinksService(config);
|
|
586
|
+
}
|
|
587
|
+
getName() {
|
|
588
|
+
return 'get_active_outlinks';
|
|
589
|
+
}
|
|
590
|
+
getDescription() {
|
|
591
|
+
return 'Get active outbound links from a domain or URL. Returns external links the site points to, including target URLs, anchor text, link attributes (nofollow/dofollow), link types, and discovery dates. Useful for analyzing linking strategies, finding partnership opportunities, and auditing outbound link profiles.';
|
|
592
|
+
}
|
|
593
|
+
getInputSchema() {
|
|
594
|
+
return {
|
|
595
|
+
type: "object",
|
|
596
|
+
properties: {
|
|
597
|
+
query: {
|
|
598
|
+
type: "string",
|
|
599
|
+
minLength: constants_js_1.MIN_DOMAIN_LENGTH,
|
|
600
|
+
maxLength: constants_js_1.MAX_DOMAIN_LENGTH,
|
|
601
|
+
description: "Domain name or URL to analyze for outbound links"
|
|
602
|
+
},
|
|
603
|
+
searchType: {
|
|
604
|
+
type: "string",
|
|
605
|
+
enum: constants_js_1.SEARCH_TYPES_URL,
|
|
606
|
+
default: "domain",
|
|
607
|
+
description: "Type of search: domain, domain_with_subdomains, url, or part_url"
|
|
608
|
+
},
|
|
609
|
+
sort: {
|
|
610
|
+
type: "string",
|
|
611
|
+
enum: constants_js_1.ACTIVE_OUTLINKS_SORT_FIELDS,
|
|
612
|
+
default: "check",
|
|
613
|
+
description: "Field to sort results by"
|
|
614
|
+
},
|
|
615
|
+
order: {
|
|
616
|
+
type: "string",
|
|
617
|
+
enum: constants_js_1.SORT_ORDER,
|
|
618
|
+
default: "desc",
|
|
619
|
+
description: "Sort order: asc or desc"
|
|
620
|
+
},
|
|
621
|
+
linkPerDomain: {
|
|
622
|
+
type: "integer",
|
|
623
|
+
minimum: 1,
|
|
624
|
+
description: "Maximum number of links to return per domain"
|
|
625
|
+
},
|
|
626
|
+
page: {
|
|
627
|
+
type: "integer",
|
|
628
|
+
minimum: constants_js_1.MIN_PAGE,
|
|
629
|
+
default: 1,
|
|
630
|
+
description: "Page number for pagination"
|
|
631
|
+
},
|
|
632
|
+
size: {
|
|
633
|
+
type: "integer",
|
|
634
|
+
minimum: 1,
|
|
635
|
+
maximum: constants_js_1.MAX_PAGE_SIZE,
|
|
636
|
+
default: constants_js_1.DEFAULT_PAGE_SIZE,
|
|
637
|
+
description: "Number of results per page"
|
|
638
|
+
}
|
|
639
|
+
},
|
|
640
|
+
required: ["query", "searchType"],
|
|
641
|
+
additionalProperties: false
|
|
642
|
+
};
|
|
643
|
+
}
|
|
644
|
+
async handle(call) {
|
|
645
|
+
try {
|
|
646
|
+
const params = validation_js_1.getActiveOutlinksSchema.parse(call.arguments);
|
|
647
|
+
const result = await this.backlinksService.getActiveOutlinks(params);
|
|
648
|
+
return this.createSuccessResponse(result);
|
|
649
|
+
}
|
|
650
|
+
catch (error) {
|
|
651
|
+
if (error instanceof zod_1.z.ZodError) {
|
|
652
|
+
return this.createErrorResponse(new Error('Invalid parameters: ' + error.errors.map(e => e.path.join('.') + ': ' + e.message).join(', ')));
|
|
653
|
+
}
|
|
654
|
+
return this.createErrorResponse(error);
|
|
655
|
+
}
|
|
656
|
+
}
|
|
657
|
+
}
|
|
658
|
+
exports.GetActiveOutlinksHandler = GetActiveOutlinksHandler;
|
|
659
|
+
class GetActiveOutlinkDomainsHandler extends base_js_1.BaseHandler {
|
|
660
|
+
backlinksService;
|
|
661
|
+
constructor() {
|
|
662
|
+
super();
|
|
663
|
+
const config = (0, config_js_1.loadConfig)();
|
|
664
|
+
this.backlinksService = new backlinks_tools_js_1.BacklinksService(config);
|
|
665
|
+
}
|
|
666
|
+
getName() {
|
|
667
|
+
return 'get_active_outlink_domains';
|
|
668
|
+
}
|
|
669
|
+
getDescription() {
|
|
670
|
+
return 'Get external domains that receive outbound links from the analyzed domain. Returns target domains with total link counts, revealing partnership networks, referenced sources, and linking patterns. Helps identify collaboration opportunities by analyzing which domains competitors link to.';
|
|
671
|
+
}
|
|
672
|
+
getInputSchema() {
|
|
673
|
+
return {
|
|
674
|
+
type: "object",
|
|
675
|
+
properties: {
|
|
676
|
+
query: {
|
|
677
|
+
type: "string",
|
|
678
|
+
description: "Domain name to analyze outbound link destinations",
|
|
679
|
+
minLength: constants_js_1.MIN_DOMAIN_LENGTH,
|
|
680
|
+
maxLength: constants_js_1.MAX_DOMAIN_LENGTH
|
|
681
|
+
},
|
|
682
|
+
searchType: {
|
|
683
|
+
type: "string",
|
|
684
|
+
enum: constants_js_1.SEARCH_TYPES_URL,
|
|
685
|
+
description: "Search type for analysis",
|
|
686
|
+
default: "domain"
|
|
687
|
+
},
|
|
688
|
+
sort: {
|
|
689
|
+
type: "string",
|
|
690
|
+
enum: constants_js_1.ACTIVE_OUTLINK_DOMAINS_SORT_FIELDS,
|
|
691
|
+
description: "Field to sort results by",
|
|
692
|
+
default: "domain_rank"
|
|
693
|
+
},
|
|
694
|
+
order: {
|
|
695
|
+
type: "string",
|
|
696
|
+
enum: constants_js_1.SORT_ORDER,
|
|
697
|
+
description: "Sort order",
|
|
698
|
+
default: "desc"
|
|
699
|
+
},
|
|
700
|
+
page: {
|
|
701
|
+
type: "integer",
|
|
702
|
+
description: "Page number for pagination",
|
|
703
|
+
minimum: constants_js_1.MIN_PAGE,
|
|
704
|
+
default: 1
|
|
705
|
+
},
|
|
706
|
+
size: {
|
|
707
|
+
type: "integer",
|
|
708
|
+
description: "Number of results per page",
|
|
709
|
+
minimum: 1,
|
|
710
|
+
maximum: constants_js_1.MAX_PAGE_SIZE,
|
|
711
|
+
default: constants_js_1.DEFAULT_PAGE_SIZE
|
|
712
|
+
}
|
|
713
|
+
},
|
|
714
|
+
required: ["query", "searchType"],
|
|
715
|
+
additionalProperties: false
|
|
716
|
+
};
|
|
717
|
+
}
|
|
718
|
+
async handle(call) {
|
|
719
|
+
try {
|
|
720
|
+
const params = validation_js_1.getActiveOutlinkDomainsSchema.parse(call.arguments);
|
|
721
|
+
const result = await this.backlinksService.getActiveOutlinkDomains(params);
|
|
722
|
+
return this.createSuccessResponse(result);
|
|
723
|
+
}
|
|
724
|
+
catch (error) {
|
|
725
|
+
if (error instanceof zod_1.z.ZodError) {
|
|
726
|
+
return this.createErrorResponse(new Error('Invalid parameters: ' + error.errors.map(e => e.path.join('.') + ': ' + e.message).join(', ')));
|
|
727
|
+
}
|
|
728
|
+
return this.createErrorResponse(error);
|
|
729
|
+
}
|
|
730
|
+
}
|
|
731
|
+
}
|
|
732
|
+
exports.GetActiveOutlinkDomainsHandler = GetActiveOutlinkDomainsHandler;
|
|
733
|
+
class GetThreatBacklinksHandler extends base_js_1.BaseHandler {
|
|
734
|
+
backlinksService;
|
|
735
|
+
constructor() {
|
|
736
|
+
super();
|
|
737
|
+
const config = (0, config_js_1.loadConfig)();
|
|
738
|
+
this.backlinksService = new backlinks_tools_js_1.BacklinksService(config);
|
|
739
|
+
}
|
|
740
|
+
getName() {
|
|
741
|
+
return 'get_threat_backlinks';
|
|
742
|
+
}
|
|
743
|
+
getDescription() {
|
|
744
|
+
return 'Get malicious backlinks pointing to the analyzed domain. Returns links from sites flagged for threats like social engineering, malware, or unwanted software. Shows referring domain, source URL, target URL, platform type, threat type, and last update date. Essential for identifying and removing harmful backlinks that could damage domain reputation and SEO rankings.';
|
|
745
|
+
}
|
|
746
|
+
getInputSchema() {
|
|
747
|
+
return {
|
|
748
|
+
type: "object",
|
|
749
|
+
properties: {
|
|
750
|
+
query: {
|
|
751
|
+
type: "string",
|
|
752
|
+
pattern: constants_js_1.DOMAIN_NAME_REGEX,
|
|
753
|
+
minLength: constants_js_1.MIN_DOMAIN_LENGTH,
|
|
754
|
+
maxLength: constants_js_1.MAX_DOMAIN_LENGTH,
|
|
755
|
+
description: "Domain to analyze for threat backlinks"
|
|
756
|
+
},
|
|
757
|
+
searchType: {
|
|
758
|
+
type: "string",
|
|
759
|
+
enum: constants_js_1.SEARCH_TYPES,
|
|
760
|
+
default: "domain",
|
|
761
|
+
description: "Search type: 'domain' (exact domain) or 'domain_with_subdomains' (includes subdomains)"
|
|
762
|
+
},
|
|
763
|
+
sort: {
|
|
764
|
+
type: "string",
|
|
765
|
+
enum: constants_js_1.BACKLINKS_THREAT_SORT_FIELDS,
|
|
766
|
+
default: "lastupdate",
|
|
767
|
+
description: "Field to sort by: lastupdate, url_from, url_to, platform_type, threat_type"
|
|
768
|
+
},
|
|
769
|
+
order: {
|
|
770
|
+
type: "string",
|
|
771
|
+
enum: constants_js_1.SORT_ORDER,
|
|
772
|
+
default: "desc",
|
|
773
|
+
description: "Sort order: asc or desc"
|
|
774
|
+
},
|
|
775
|
+
linkPerDomain: {
|
|
776
|
+
type: "integer",
|
|
777
|
+
minimum: 1,
|
|
778
|
+
description: "Maximum number of links per domain to return"
|
|
779
|
+
},
|
|
780
|
+
page: {
|
|
781
|
+
type: "integer",
|
|
782
|
+
description: "Page number for pagination",
|
|
783
|
+
minimum: constants_js_1.MIN_PAGE,
|
|
784
|
+
default: 1
|
|
785
|
+
},
|
|
786
|
+
size: {
|
|
787
|
+
type: "integer",
|
|
788
|
+
description: "Number of results per page",
|
|
789
|
+
minimum: 1,
|
|
790
|
+
maximum: constants_js_1.MAX_PAGE_SIZE,
|
|
791
|
+
default: constants_js_1.DEFAULT_PAGE_SIZE
|
|
792
|
+
}
|
|
793
|
+
},
|
|
794
|
+
required: ["query"],
|
|
795
|
+
additionalProperties: false
|
|
796
|
+
};
|
|
797
|
+
}
|
|
798
|
+
async handle(call) {
|
|
799
|
+
try {
|
|
800
|
+
const params = validation_js_1.getThreatBacklinksSchema.parse(call.arguments);
|
|
801
|
+
const result = await this.backlinksService.getThreatBacklinks(params);
|
|
802
|
+
return this.createSuccessResponse(result);
|
|
803
|
+
}
|
|
804
|
+
catch (error) {
|
|
805
|
+
if (error instanceof zod_1.z.ZodError) {
|
|
806
|
+
return this.createErrorResponse(new Error('Invalid parameters: ' + error.errors.map(e => e.path.join('.') + ': ' + e.message).join(', ')));
|
|
807
|
+
}
|
|
808
|
+
return this.createErrorResponse(error);
|
|
809
|
+
}
|
|
810
|
+
}
|
|
811
|
+
}
|
|
812
|
+
exports.GetThreatBacklinksHandler = GetThreatBacklinksHandler;
|
|
408
813
|
//# sourceMappingURL=backlinks_tools.js.map
|