Skip to main content
Glama
ravinwebsurgeon

DataForSEO MCP Server

backlinks_anchors

Analyze anchor text distribution from backlinks to understand how other websites reference a target domain, subdomain, or webpage for SEO insights.

Instructions

This endpoint will provide you with a detailed overview of anchors used when linking to the specified website with relevant backlink data for each of them

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
targetYesdomain, subdomain or webpage to get backlinks for required field a domain or a subdomain should be specified without https:// and www. a page should be specified with absolute URL (including http:// or https://)
limitNothe maximum number of returned anchors
offsetNooffset in the results array of returned anchors optional field default value: 0 if you specify the 10 value, the first ten anchors in the results array will be omitted and the data will be provided for the successive anchors
filtersNoarray of results filtering parameters optional field 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: =, <>, in, not_in, like, not_like, ilike, not_ilike, regex, not_regex, match, not_match you can use the % operator with like and not_like to match any string of zero or more characters example: ["rank",">","80"] [["page_from_rank",">","55"], "and", ["dofollow","=",true]] [["first_seen",">","2017-10-23 11:31:45 +00:00"], "and", [["anchor","like","%seo%"],"or",["text_pre","like","%seo%"]]]
order_byNoresults sorting rules optional field you can use the same values as in the filters array to sort the results possible sorting types: asc – results will be sorted in the ascending order desc – results will be sorted in the descending order you should use a comma to set up a sorting type example: ["rank,desc"] note that you can set no more than three sorting rules in a single request you should use a comma to separate several sorting rules example: ["domain_from_rank,desc","page_from_rank,asc"]

Implementation Reference

  • The handler function that implements the core logic of the 'backlinks_anchors' tool by sending a POST request to the DataForSEO Backlinks Anchors API endpoint and processing the response.
    async handle(params: any): Promise<any> {
      try {
        const response = await this.client.makeRequest('/v3/backlinks/anchors/live', 'POST', [{
          target: params.target,
          limit: params.limit,
          offset: params.offset,
          filters: this.formatFilters(params.filters),
          order_by: this.formatOrderBy(params.order_by)
        }]);
        return this.validateAndFormatResponse(response);
      } catch (error) {
        return this.formatErrorResponse(error);
      }
    }
  • Zod schema defining the input parameters for the tool: target (required string), limit, offset, filters (array), order_by (array). Includes detailed descriptions.
      getParams(): z.ZodRawShape {
        return {
          target: z.string().describe(`domain, subdomain or webpage to get backlinks for
            required field
    a domain or a subdomain should be specified without https:// and www.
    a page should be specified with absolute URL (including http:// or https://)`),
          limit: z.number().min(1).max(1000).default(10).optional().describe("the maximum number of returned anchors"),
          offset: z.number().min(0).optional().describe(
            `offset in the results array of returned anchors
    optional field
    default value: 0
    if you specify the 10 value, the first ten anchors in the results array will be omitted and the data will be provided for the successive anchors`
          ),
          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(
            `array of results filtering parameters
    optional field
    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:
    =, <>, in, not_in, like, not_like, ilike, not_ilike, regex, not_regex, match, not_match
    you can use the % operator with like and not_like to match any string of zero or more characters
    example:
    ["rank",">","80"]
    [["page_from_rank",">","55"],
    "and",
    ["dofollow","=",true]]
    
    [["first_seen",">","2017-10-23 11:31:45 +00:00"],
    "and",
    [["anchor","like","%seo%"],"or",["text_pre","like","%seo%"]]]`
          ),
          order_by: z.array(z.string()).optional().describe(
            `results sorting rules
    optional field
    you can use the same values as in the filters array to sort the results
    possible sorting types:
    asc – results will be sorted in the ascending order
    desc – results will be sorted in the descending order
    you should use a comma to set up a sorting type
    example:
    ["rank,desc"]
    note that you can set no more than three sorting rules in a single request
    you should use a comma to separate several sorting rules
    example:
    ["domain_from_rank,desc","page_from_rank,asc"]`
          ),
        };
      }
  • Registers the 'backlinks_anchors' tool (instantiated at line 32) by including it in the tools array and reducing to a record mapped by tool name, exposing description, params, and handler for MCP integration.
    getTools(): Record<string, ToolDefinition> {
      const tools = [
        new BacklinksTool(this.dataForSEOClient),
        new BacklinksAnchorTool(this.dataForSEOClient),
        new BacklinksBulkBacklinksTool(this.dataForSEOClient),
        new BacklinksBulkNewLostReferringDomainsTool(this.dataForSEOClient),
        new BacklinksBulkNewLostBacklinksTool(this.dataForSEOClient),
        new BacklinksBulkRanksTool(this.dataForSEOClient),
        new BacklinksBulkReferringDomainsTool(this.dataForSEOClient),
        new BacklinksBulkSpamScoreTool(this.dataForSEOClient),
        new BacklinksCompetitorsTool(this.dataForSEOClient),
        new BacklinksDomainIntersectionTool(this.dataForSEOClient),
        new BacklinksDomainPagesSummaryTool(this.dataForSEOClient),
        new BacklinksDomainPagesTool(this.dataForSEOClient),
        new BacklinksPageIntersectionTool(this.dataForSEOClient),
        new BacklinksReferringDomainsTool(this.dataForSEOClient),
        new BacklinksReferringNetworksTool(this.dataForSEOClient),
        new BacklinksSummaryTool(this.dataForSEOClient),
        new BacklinksTimeseriesNewLostSummaryTool(this.dataForSEOClient),
        new BacklinksTimeseriesSummaryTool(this.dataForSEOClient),
        new BacklinksBulkPagesSummaryTool(this.dataForSEOClient),
        new BacklinksFiltersTool(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),
        },
      }), {});
    }
  • Import statement for the BacklinksAnchorTool class used in registration.
    import { BacklinksAnchorTool } from './tools/backlinks-anchor.tool.js';
  • Maps 'backlinks_anchors' tool name to 'anchors' filter path in the API response, used by the filters tool to provide filter information.
    private static readonly TOOL_TO_FILTER_MAP: { [key: string]: string } = {
      'backlinks_content_duplicates': 'content_duplicates',
      'backlinks_backlinks': 'backlinks',
      'backlinks_domain_pages': 'domain_pages',
      'backlinks_anchors': 'anchors',
      'backlinks_referring_domains': 'referring_domains',
      'backlinks_domain_intersection': 'domain_intersection',
      'backlinks_page_intersection': 'page_intersection',
      'backlinks_referring_networks': 'referring_networks',
      'backlinks_domain_pages_summary': 'domain_pages_summary',
      'backlinks_competitors': 'competitors'
    };
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 provides 'a detailed overview' and 'relevant backlink data', but fails to describe critical behaviors: whether this is a read-only operation, if it requires authentication, rate limits, pagination details beyond limit/offset, error handling, or the structure of the returned data. For a tool with 5 parameters and no output schema, this is a significant gap.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that gets straight to the point without unnecessary words. It's appropriately sized for a tool with this complexity, though it could be slightly more structured by explicitly mentioning key capabilities like filtering and sorting that are detailed in the schema.

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 (5 parameters, no annotations, no output schema, and many sibling tools), the description is inadequate. It doesn't explain the return format, differentiate from alternatives, or provide behavioral context needed for safe invocation. The agent would struggle to use this tool effectively without additional documentation or trial-and-error.

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 parameters thoroughly. The description adds no additional meaning about parameters beyond implying the tool returns anchor data for backlinks. It doesn't explain relationships between parameters (e.g., how filters interact with order_by) or provide usage examples. Baseline 3 is appropriate when the schema does the heavy lifting.

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 a detailed overview of anchors used when linking to the specified website with relevant backlink data for each of them'. It specifies the verb ('provide'), resource ('anchors'), and scope ('linking to the specified website'), though it doesn't explicitly differentiate from sibling tools like 'backlinks_backlinks' or 'backlinks_summary', which appear related but have different focuses.

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 offers no guidance on when to use this tool versus alternatives. With many sibling tools in the 'backlinks_' category (e.g., 'backlinks_backlinks', 'backlinks_summary', 'backlinks_competitors'), there's no indication of how this tool differs or when it's the appropriate choice, leaving the agent to guess based on names alone.

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