Skip to main content
Glama
whisper-sec

WhisperGraph MCP Server

Official

Typosquat / Brand-Protection Variants

domain_variants
Read-onlyIdempotent

Generate typosquatting variants of a domain using 14 mutation algorithms and return those registered in WhisperGraph for brand protection.

Instructions

Generate typosquatting / brand-protection variants of a domain or brand name and check which ones actually exist in WhisperGraph.

Runs 14 mutation algorithms — character omission, repetition, transposition, QWERTY-adjacent replacement/insertion, vowel-swap, bitsquatting, homoglyph / Unicode confusables, hyphenation, dot insertion/omission, TLD-swap, TLD-addition, and subdomain-add. Unicode input is accepted (and expected) so IDN homoglyph lookalikes resolve correctly.

Returns { rows: [...] }. Each row: { variant, method, exists, nodeId, label, confidence (0.3-0.9), confidenceLabel (low/medium/high) }. By default only variants that EXIST as nodes are returned — the registered lookalikes worth investigating. Note that "exists" means registered/observed, NOT malicious: pivot each hit through explain_indicator for a threat verdict.

Arguments:

  • name (string, required) — the domain or brand to mutate, e.g. "google.com". Allowed characters: letters (including Unicode), digits, '.', '-', '_'.

  • label (string, optional, default HOSTNAME) — node label to check existence against.

  • includeNonExistent (boolean, optional, default false) — when true, also return generated variants that do NOT exist in the graph (larger, noisier result set).

Performance: typically <150ms. Results are capped at 500 rows.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesDomain or brand to generate variants for. Examples: "google.com", "paypal.com". Unicode allowed.
labelNoOptional node label to check existence against. Default: HOSTNAME.
includeNonExistentNoOptional. When true, also return generated variants that do not exist in the graph. Default: false.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
rowsYes

Implementation Reference

  • The domainVariants() method on IndicatorTools class. Validates the variant name and label patterns, then calls `CALL whisper.variants($name, $label, $checkExisting)` via the GraphBackend. Truncates results at MAX_VARIANT_ROWS (500). On failure, returns a structured error row.
    async domainVariants(
      name: string | null | undefined,
      label: string | null | undefined,
      includeNonExistent: boolean,
      credential: Credential | null,
    ): Promise<{ rows: Row[] }> {
      if (!isValidVariantName(name)) {
        return {
          rows: [
            {
              name: name ?? "",
              available: false,
              error: "invalid_name",
              explanation:
                "Name must be a domain or hostname. Allowed characters: letters " +
                "(including Unicode, for homoglyph detection), digits, '.', '-', '_'.",
            },
          ],
        };
      }
    
      const resolvedLabel =
        label == null || label.trim() === "" ? "HOSTNAME" : label.trim().toUpperCase();
      if (!LABEL_PATTERN.test(resolvedLabel)) {
        return {
          rows: [
            {
              name,
              available: false,
              error: "invalid_label",
              explanation:
                "Label must be uppercase letters and underscores only (e.g. HOSTNAME, MAIL_SERVER).",
            },
          ],
        };
      }
    
      try {
        const raw = await this.backend.execute(
          "CALL whisper.variants($name, $label, $checkExisting)",
          { name, label: resolvedLabel, checkExisting: !includeNonExistent },
          credential,
        );
        const rows = raw.rows ?? [];
        return { rows: rows.length > MAX_VARIANT_ROWS ? rows.slice(0, MAX_VARIANT_ROWS) : rows };
      } catch (error) {
        log.warn(`domain_variants failed for "${name}": ${describeError(error)}`);
        return {
          rows: [
            {
              name,
              available: false,
              error: "lookup_failed",
              explanation: "Variant generation is temporarily unavailable. Try again in a moment.",
            },
          ],
        };
      }
    }
  • src/server.ts:206-241 (registration)
    Registration of the 'domain_variants' tool on the MCP server via server.registerTool(). Defines inputSchema with Zod for 'name' (required string), 'label' (optional string default HOSTNAME), and 'includeNonExistent' (optional boolean default false). Output is an array of rows. The handler calls indicatorTools.domainVariants() with the extracted args.
    server.registerTool(
      "domain_variants",
      {
        title: "Typosquat / Brand-Protection Variants",
        description: DOMAIN_VARIANTS_DESCRIPTION,
        inputSchema: {
          name: z
            .string()
            .describe(
              'Domain or brand to generate variants for. Examples: "google.com", "paypal.com". Unicode allowed.',
            ),
          label: z
            .string()
            .optional()
            .describe("Optional node label to check existence against. Default: HOSTNAME."),
          includeNonExistent: z
            .boolean()
            .optional()
            .describe(
              "Optional. When true, also return generated variants that do not exist in the graph. Default: false.",
            ),
        },
        outputSchema: { rows: z.array(rowSchema) },
        annotations: READ_ONLY_ANNOTATIONS,
      },
      async (args, extra) => {
        const credential = resolveCredential(extra.requestInfo?.headers, config.apiKey);
        const result = await indicatorTools.domainVariants(
          args.name,
          args.label,
          args.includeNonExistent ?? false,
          credential,
        );
        return toolResult(result);
      },
    );
  • DOMAIN_VARIANTS_DESCRIPTION constant providing the full documentation for the tool. Describes the 14 mutation algorithms, return shape (variant, method, exists, nodeId, label, confidence, confidenceLabel), and argument details.
    export const DOMAIN_VARIANTS_DESCRIPTION = `Generate typosquatting / brand-protection variants of a domain or brand name and check which ones actually exist in WhisperGraph.
    
    Runs 14 mutation algorithms — character omission, repetition, transposition, QWERTY-adjacent replacement/insertion, vowel-swap, bitsquatting, homoglyph / Unicode confusables, hyphenation, dot insertion/omission, TLD-swap, TLD-addition, and subdomain-add. Unicode input is accepted (and expected) so IDN homoglyph lookalikes resolve correctly.
    
    Returns { rows: [...] }. Each row: { variant, method, exists, nodeId, label, confidence (0.3-0.9), confidenceLabel (low/medium/high) }. By default only variants that EXIST as nodes are returned — the registered lookalikes worth investigating. Note that "exists" means registered/observed, NOT malicious: pivot each hit through explain_indicator for a threat verdict.
    
    Arguments:
      - name (string, required) — the domain or brand to mutate, e.g. "google.com". Allowed characters: letters (including Unicode), digits, '.', '-', '_'.
      - label (string, optional, default HOSTNAME) — node label to check existence against.
      - includeNonExistent (boolean, optional, default false) — when true, also return generated variants that do NOT exist in the graph (larger, noisier result set).
    
    Performance: typically <150ms. Results are capped at 500 rows.`;
  • The isValidVariantName() helper function that validates the variant name using VARIANT_NAME_PATTERN (Unicode letters, digits, dot, dash, underscore, 1-255 chars). Used by domainVariants() to reject invalid input before making the backend call.
    function isValidVariantName(name: string | null | undefined): name is string {
      return name != null && VARIANT_NAME_PATTERN.test(name);
    }
  • Constants used by domainVariants: VARIANT_NAME_PATTERN (Unicode-enabled regex for domain names), LABEL_PATTERN (uppercase letters/underscores for labels), and MAX_VARIANT_ROWS (500 cap on results).
    /**
     * Variant-name whitelist for `whisper.variants()`. Admits Unicode letters and
     * digits — homoglyph / IDN detection feeds on confusable scripts — while still
     * excluding Cypher-special characters. Capped at a domain name's RFC limit.
     */
    const VARIANT_NAME_PATTERN = /^[\p{L}\p{N}._-]{1,255}$/u;
    
    /** Node label names: uppercase ASCII letters and underscores. */
    const LABEL_PATTERN = /^[A-Z_]{1,40}$/;
    
    /** Hard cap on variant rows returned — mirrors the validator's LIMIT ceiling. */
    const MAX_VARIANT_ROWS = 500;
Behavior5/5

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

Annotations already mark the tool as read-only and idempotent. The description adds significant behavioral details: lists 14 mutation algorithms, states performance is typically <150ms, results capped at 500 rows, and explains the output format and meaning of 'exists'. No contradictions with annotations.

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 well-organized with a clear summary, algorithm list, output format, and parameter details. It is appropriately sized but a few sentences could be tightened without losing clarity.

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?

Given the tool's complexity (14 algorithms, output schema provided), the description covers all essential aspects: what it does, how it works, output structure, performance characteristics, and a crucial caveat about existence versus malice. It is fully sufficient for an agent to select and invoke correctly.

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 description coverage is 100%, but the description adds extra value: for 'name' it specifies allowed characters, for 'includeNonExistent' it explains the effect of the default false vs true. This goes beyond the schema's descriptions.

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 description clearly states the tool's function: 'Generate typosquatting / brand-protection variants of a domain or brand name and check which ones actually exist in WhisperGraph.' It uses specific verbs and resource, and explicitly distinguishes from sibling tools like explain_indicator.

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?

The description provides clear context for when to use the tool (generating lookalikes) and notes that results are not malicious verdicts, directing users to explain_indicator for threat assessment. It also explains optional parameters like includeNonExistent, but does not explicitly list cases where the tool should not be used.

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/whisper-sec/whisper-graph-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server