Skip to main content
Glama

Competitor Keyword Gap

competitor_gap_extractor

Compares the target and competitor domains across a caller-supplied keyword list; it does not discover a competitor's full keyword set. Domains match a result's host and its subdomains (example.com also finds blog.example.com; a listed subdomain matches only itself and below, a leading www. is dropped so www.example.com means example.com, and the most specific listed domain claims a result). results holds one row per keyword, once; top_opportunities (opportunity_score 60 or more, highest first, ties by keyword), missing_keywords and shared_keywords (in the order you supplied) name keywords of those rows. A position is a number when the site was observed and null when it was not, never 0; target_rank_status and competitor_rank_status say ranked, not_in_results (absent from a sample that proves it: outside the top verified_depth) or unknown; competitor_urls gives the result URL behind each competitor position, and top_domains the first 5 sites the sample shows with their positions, so a keyword where no listed competitor ranks still says who does. keyword_difficulty_note states once what each row's keyword_difficulty estimate is. Every row carries its sample: serp_results_returned, strict serp_complete, observed_at, cache_age_seconds and verified_depth, the N for which an absent site is proven to be outside the top N (often a little less than the requested depth: Google's pages carry eight to ten organic results). A category that claims an absence (missing, neither, target_only) is provisional only when the sample proves none: a results page could not be fetched or a result could not be tied to a site. opportunity_score is a documented heuristic; score_inputs and score_method show how it was computed. Credits: per Google results page actually fetched (5 live, 0 cached) for audited keywords; depth defaults to 10 results (one page, 5 credits a keyword when live) and deeper samples cost more (30 results = 3 pages, up to 15 credits a keyword). When the daily live-page allowance or the balance does not cover live pages, cached keywords are still served at no charge and the rest are not sampled (error_code DAILY_LIVE_LIMIT or INSUFFICIENT_CREDITS). market_check says whether the country the results are for is confirmed: confirmed (market_evidence.method says by what: page_data or page_footer, Google's own page states it; provider_echo, the search provider states the country it searched), or unconfirmed (nothing states it; the page is returned but never recorded as a rank observation). A page produced for another country is discarded and fetched again; MARKET_MISMATCH means no fetch gave the requested country. With project_id, only a page fetched for the call is recorded as an observation of the project's saved keywords: a page answered from storage (cache_hit) is not a new observation, and project_link.note says so; freshness "fresh" observes now. Each row's keyword_difficulty is DataFluxor's own estimate of how hard that search is to rank for (score 0-100, band, confidence, signals), from the results page the row was read from; it is not a backlink-based or Google figure. The result is returned here and may also be kept for up to 30 days as a completed run: retained.run_id reads it again for free with scraper_run_get (retained.available false says why it was not kept). Saved synchronous results can be evicted earlier when storage is needed; set background true (with an idempotency_key) to start the work as a saved run at once. If the call would outlast the connection (many items, deep or fresh SERPs) or the platform has no free capacity, it is not failed: the result is an accepted answer (accepted true, run_id, state, next_step) and the work runs as a saved run; ask scraper_run_get about run_id (view status) as often as retry_after_seconds says. A batch tool's run is charged item by item as each item finishes (failed items are free); any other run once, when it completes. The same idempotency_key prevents a second charge during its retry window; a later new call may be charged.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "target_domain": "<target_domain>",
      "competitor_domains": "<competitor_domains>",
      "keywords": "<keywords>",
      "country": "<country>"
    },
    "name": "competitor_gap_extractor"
  }
}

Input Schema

NameRequiredDescriptionDefault
depthNoOrganic results sampled per keyword (1-100, default 10: the top 10, one page, 5 credits a keyword). Every 10 results is one Google results page: 5 credits when fetched live, 0 when served from cache.
countryYesTwo-letter country code of a supported Google market; see GET /api/v1/serp/markets.
keywordsYesKeywords to analyze
languageNoResult language (Google hl). Defaults to the market's own language; markets served through the managed SERP API accept any language code, e.g. en for English results in DE.
freshnessNoReuse of stored Google results pages. standard (default): a page fetched within this tool's window (24 hours; 6 hours with project_id unless max_age_seconds says otherwise) may answer, at 0 credits instead of 5. fresh: every page is fetched live now. A result says what it used at its top level: cache_hit, with cache_age_seconds (one search) or rows_from_cache and oldest_page_age_seconds (several searches).
verbosityNoconcise: short summary of the answer; full: the whole answer. Only shapes the output. Send idempotency_key to read the other form later without a new charge.
backgroundNoOptional. true starts this work as a saved background run and answers at once with run_id instead of the result; read it with scraper_run_get. Needs an idempotency_key: the same key returns the same run and never charges twice, for the 30 days the run is kept. Charged like the direct call, as the run's work completes. Without it, a call that would take too long is also answered as a saved run.
project_idNoOptional: a project of this organization (projects_list shows them). The result is then linked to the project's saved keywords that it observed, so saved_keyword_get can answer from it later, and it carries project_link (the saved keywords matched). Costs nothing extra. Omit it for a call that belongs to no project.
target_domainYesYour target domain. A domain such as example.com also matches its subdomains (blog.example.com); a subdomain such as blog.example.com matches only itself and below; a leading www. is dropped
idempotency_keyNoOptional retry key bound to this customer and these arguments. Matching retries replay the first result and do not reserve a second credit; the replay says so in billing (replayed true, credits_charged_this_call 0, original_credits_used).
max_age_secondsNoOldest stored results page that may answer, in seconds (60 to 86400); older pages are fetched live. Default: this tool's window (24 hours), or 6 hours (21600) when project_id is given and max_age_seconds is not, because a day-old page is not where a site ranks now.
competitor_domainsYesList of competitor domains, matched the same way as target_domain

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.5/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With annotations only covering readOnly/openWorld/destructive/idempotent flags, the description carries the real burden and does so thoroughly: credit costs per fetched page and per depth, cache behavior, daily-live-limit and insufficient-credit failure modes, provisional vs. proven absence, market confirmation, 30-day retention, eviction, and background-run semantics. It also defines output semantics (null vs. 0 positions, rank status values) that no schema communicates.

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

Conciseness3/5

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

The content is front-loaded with the purpose, but the body is a single unbroken block of roughly 600 words mixing pricing, ranking semantics, caching, retention, and output shape. Several facts (depth/pricing, cache credits) duplicate the schema, and the lack of paragraph or list structure makes it costly to parse despite each clause carrying information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 12-parameter, credit-charging, cache-aware tool with no output schema, the description supplies everything an agent needs: return structure, rank-status vocabulary, sampling guarantees, failure codes, and run-retrieval path. Nothing material about invoking or interpreting the call is left unstated.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3; the description exceeds that by explaining host/subdomain matching rules, how depth translates into pages and credits, and what project_id links to. Much of this restates or parallels the schema's own descriptions (depth credits, freshness), so it is additive but partly redundant.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The opening sentence names a specific operation on specific resources: comparing target and competitor domains over a caller-supplied keyword list. It immediately rules out the adjacent-but-different job of discovering a competitor's full keyword set, which separates it from keyword-research siblings without needing their schemas.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It clearly frames the input precondition (you must already have a keyword list) and explicitly excludes discovery work, which implicitly routes keyword-discovery needs elsewhere. It also explains background vs. synchronous use and when to poll with scraper_run_get. What it lacks is a named alternative for keyword discovery (e.g. keyword_research) to make the routing fully explicit.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources