Skip to main content
Glama
patchwindow

seo-mcp

by patchwindow

gsc_striking_distance

Identify queries ranking in positions 4–20 (striking distance) to find low-hanging fruit for quick ranking improvements. Results sorted by impressions descending.

Instructions

Find queries ranking in positions 4–20 (striking distance / low-hanging fruit). These are the best candidates for quick ranking improvements. Results sorted by impressions descending.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
site_urlNoSite URL in GSC format, e.g. 'sc-domain:example.com'. Uses config default if omitted.
start_dateYesStart date in YYYY-MM-DD format.
end_dateYesEnd date in YYYY-MM-DD format.
min_positionNoMinimum average position to include. Default: 4.
max_positionNoMaximum average position to include. Default: 20.
min_impressionsNoMinimum impressions to include. Default: 10.
row_limitNoMax rows to return. Default: 50.

Implementation Reference

  • The handler function that executes the gsc_striking_distance tool logic: queries GSC Search Analytics, filters for positions 4-20 (striking distance), sorts by impressions descending, and returns results as a tab-separated table.
      handler: async (args, config) => {
        const auth = getOAuth2Client();
        const sc = google.searchconsole({ version: "v1", auth });
    
        const siteUrl = args.site_url ?? config.gsc?.default_site;
        if (!siteUrl) {
          throw new Error(
            "site_url is required. Pass it as an argument or set gsc.default_site in ~/.seo-mcp/config.json"
          );
        }
    
        const minPos = args.min_position ?? 4;
        const maxPos = args.max_position ?? 20;
        const minImpressions = args.min_impressions ?? 10;
        const rowLimit = args.row_limit ?? 50;
    
        const res = await sc.searchanalytics.query({
          siteUrl,
          requestBody: {
            startDate: args.start_date,
            endDate: args.end_date,
            dimensions: ["query"],
            rowLimit: 5000,
          },
        });
    
        const rows = res.data.rows ?? [];
        const filtered = rows
          .filter((r) => {
            const pos = r.position ?? 0;
            const imp = r.impressions ?? 0;
            return pos >= minPos && pos <= maxPos && imp >= minImpressions;
          })
          .sort((a, b) => (b.impressions ?? 0) - (a.impressions ?? 0))
          .slice(0, rowLimit);
    
        if (filtered.length === 0) {
          return {
            content: [
              {
                type: "text",
                text: `No queries found in positions ${minPos}–${maxPos} with ≥${minImpressions} impressions.`,
              },
            ],
          };
        }
    
        const summary = `Found ${filtered.length} queries in striking distance (positions ${minPos}–${maxPos}).\n\n`;
        const header = "query\tposition\timpressions\tclicks\tctr";
        const lines = filtered.map((r) => {
          const query = r.keys?.[0] ?? "";
          const pos = r.position?.toFixed(1) ?? "—";
          const ctr = ((r.ctr ?? 0) * 100).toFixed(2) + "%";
          return `${query}\t${pos}\t${r.impressions ?? 0}\t${r.clicks ?? 0}\t${ctr}`;
        });
    
        return { content: [{ type: "text", text: summary + [header, ...lines].join("\n") }] };
      },
    };
  • Zod schema defining input parameters: site_url (optional), start_date, end_date, min_position (default 4), max_position (default 20), min_impressions (default 10), row_limit (default 50).
    const schema = z.object({
      site_url: z.string().optional().describe(
        "Site URL in GSC format, e.g. 'sc-domain:example.com'. Uses config default if omitted."
      ),
      start_date: z.string().describe("Start date in YYYY-MM-DD format."),
      end_date: z.string().describe("End date in YYYY-MM-DD format."),
      min_position: z.number().optional().describe("Minimum average position to include. Default: 4."),
      max_position: z.number().optional().describe("Maximum average position to include. Default: 20."),
      min_impressions: z.number().optional().describe("Minimum impressions to include. Default: 10."),
      row_limit: z.number().optional().describe("Max rows to return. Default: 50."),
    });
  • Import and registration of gscStrikingDistance in the gscTools array, which is the list of all GSC tools.
    import { gscStrikingDistance } from "./striking-distance.js";
    import { gscTrafficDrop } from "./traffic-drop.js";
    import { gscUrlInspection } from "./url-inspection.js";
    import { gscSitemapList } from "./sitemap-list.js";
    import { gscBrandNonbrand } from "./brand-nonbrand.js";
    import type { ToolDefinition } from "../../types/tool.js";
    
    export const gscTools: ToolDefinition[] = [
      gscSearchPerformance as unknown as ToolDefinition,
      gscStrikingDistance as unknown as ToolDefinition,
      gscTrafficDrop as unknown as ToolDefinition,
      gscUrlInspection as unknown as ToolDefinition,
      gscSitemapList as unknown as ToolDefinition,
      gscBrandNonbrand as unknown as ToolDefinition,
    ];
  • Explicit registration of gscStrikingDistance as a ToolDefinition in the gscTools array.
      gscStrikingDistance as unknown as ToolDefinition,
      gscTrafficDrop as unknown as ToolDefinition,
      gscUrlInspection as unknown as ToolDefinition,
      gscSitemapList as unknown as ToolDefinition,
      gscBrandNonbrand as unknown as ToolDefinition,
    ];
  • ToolDefinition type that defines the structure of a tool including name, description, schema, and handler.
    export interface ToolDefinition<T extends AnyZodObject = AnyZodObject> {
      name: string;
      description: string;
      schema: T;
      handler: (args: z.infer<T>, config: Config) => Promise<ToolResult>;
    }
Behavior4/5

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

With no annotations, the description explains the filtering logic (positions 4-20, sorted by impressions descending) and the low-hanging fruit concept. It does not mention destructive actions (none expected) or authentication details, but is generally transparent.

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

Conciseness5/5

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

Two focused sentences with no wasted words. The main action and value proposition are front-loaded.

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

Completeness3/5

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

No output schema is provided, and the description does not specify the fields returned (e.g., query, impressions, position). Given the complexity (7 params), an agent might need to infer output structure, leaving a completeness gap.

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 coverage is 100% with descriptions for all 7 parameters, so baseline is 3. The description reinforces the default position range but adds no new information beyond the schema.

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 specifies the verb 'find' and resource 'queries ranking in positions 4–20', and the term 'striking distance / low-hanging fruit' uniquely identifies the tool's niche among siblings like gsc_search_performance.

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 states these queries are 'best candidates for quick ranking improvements', implying when to use. However, it does not explicitly exclude alternatives or provide when-not-to-use guidance.

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/patchwindow/seo-mcp'

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