Skip to main content
Glama
patchwindow

seo-mcp

by patchwindow

gsc_url_inspection

Inspect a URL's indexing verdict, canonical URL, rich results eligibility, and mobile usability in Google Search Console.

Instructions

Inspect a URL's indexing status in Google Search Console. Returns crawl date, indexing verdict, canonical URL, rich results eligibility, and mobile usability status.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesThe exact URL to inspect (must be within the site property).
site_urlNoSite URL in GSC format, e.g. 'sc-domain:example.com'. Uses config default if omitted.

Implementation Reference

  • The handler function for the gsc_url_inspection tool. It uses the Google Search Console API to inspect a URL's indexing status, returning coverage verdict, indexing state, last crawl time, canonical URLs, mobile usability, rich results, sitemap info, and referring URLs.
    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 res = await sc.urlInspection.index.inspect({
        requestBody: {
          inspectionUrl: args.url,
          siteUrl,
        },
      });
    
      const result = res.data.inspectionResult;
      if (!result) {
        return { content: [{ type: "text", text: "No inspection result returned." }] };
      }
    
      const index = result.indexStatusResult;
      const mobile = result.mobileUsabilityResult;
      const richResults = result.richResultsResult;
    
      const lines: string[] = [
        `URL: ${args.url}`,
        `Coverage verdict: ${index?.verdict ?? "UNKNOWN"}`,
        `Indexing state: ${index?.indexingState ?? "—"}`,
        `Last crawl: ${index?.lastCrawlTime ?? "never"}`,
        `Crawled as: ${index?.crawledAs ?? "—"}`,
        `Page fetch: ${index?.pageFetchState ?? "—"}`,
        `Robots.txt state: ${index?.robotsTxtState ?? "—"}`,
        `Canonical (declared): ${index?.userCanonical ?? "—"}`,
        `Canonical (Google): ${index?.googleCanonical ?? "—"}`,
      ];
    
      if (mobile) {
        lines.push(`Mobile usability: ${mobile.verdict ?? "—"}`);
        if (mobile.issues && mobile.issues.length > 0) {
          lines.push(`Mobile issues: ${mobile.issues.map((i) => i.issueType).join(", ")}`);
        }
      }
    
      if (richResults) {
        lines.push(`Rich results: ${richResults.verdict ?? "—"}`);
        if (richResults.detectedItems && richResults.detectedItems.length > 0) {
          const items = richResults.detectedItems
            .map((i) => `${i.richResultType} (${i.items?.length ?? 0} items)`)
            .join(", ");
          lines.push(`Rich result types: ${items}`);
        }
      }
    
      if (index?.sitemap && index.sitemap.length > 0) {
        lines.push(`Found in sitemaps: ${index.sitemap.join(", ")}`);
      }
    
      if (index?.referringUrls && index.referringUrls.length > 0) {
        lines.push(`Referring URLs: ${index.referringUrls.slice(0, 5).join(", ")}`);
      }
    
      return { content: [{ type: "text", text: lines.join("\n") }] };
    },
  • Zod schema defining the tool's input parameters: 'url' (required string) and 'site_url' (optional string, defaults to config value).
    const schema = z.object({
      url: z.string().describe("The exact URL to inspect (must be within the site property)."),
      site_url: z.string().optional().describe(
        "Site URL in GSC format, e.g. 'sc-domain:example.com'. Uses config default if omitted."
      ),
    });
  • Registration of gscUrlInspection in the gscTools array, making it available as a tool definition.
    gscUrlInspection as unknown as ToolDefinition,
    gscSitemapList as unknown as ToolDefinition,
    gscBrandNonbrand as unknown as ToolDefinition,
  • The ToolDefinition type used to type the gscUrlInspection constant.
    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 carries the full burden. It discloses the specific return fields (crawl date, indexing verdict, canonical URL, rich results eligibility, mobile usability status), which are behavioral traits beyond the input schema. However, it does not mention idempotency, rate limits, or auth requirements, which are minor gaps.

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?

The description is a single, well-structured sentence that front-loads the action and resource. Every clause adds value (listing return fields), with no wasted words.

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

Completeness4/5

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

Given no output schema, the description compensates by enumerating return fields. It covers the main purpose and outputs. Missing are error conditions or prerequisites (e.g., required GSC access), but for a simple inspection tool, this is adequate.

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?

The input schema already has 100% coverage with descriptions for both parameters ('url' and 'site_url'). The tool description adds no additional parameter meaning beyond the schema, earning the baseline score of 3.

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 identifies the tool as inspecting a URL's indexing status in Google Search Console, with a specific verb ('Inspect') and resource. It lists key outputs (crawl date, indexing verdict, canonical URL, rich results eligibility, mobile usability), which distinguishes it from sibling tools like bing_url_inspection (for Bing) and other GSC tools (e.g., gsc_search_performance for aggregated data).

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

Usage Guidelines3/5

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

The description implies the tool is used for inspecting individual URLs' indexing status, but it does not explicitly state when to use it (e.g., for debugging indexing issues) versus alternatives (e.g., bulk inspection not available). No exclusion criteria or context about prerequisites (e.g., property access) is provided.

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