Skip to main content
Glama
sharozdawa

indexnow-mcp

by sharozdawa

google_indexing_status

Check when a URL was last submitted to Google for indexing using the Google Indexing API. Verify indexing notification status with an access token.

Instructions

Check the indexing notification status of a URL via Google Indexing API. Shows when the URL was last submitted.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesURL to check indexing status for
access_tokenYesGoogle OAuth2 access token

Implementation Reference

  • The registration of the 'google_indexing_status' tool and its handler logic.
    server.tool(
      "google_indexing_status",
      "Check the indexing notification status of a URL via Google Indexing API. Shows when the URL was last submitted.",
      {
        url: z.string().url().describe("URL to check indexing status for"),
        access_token: z.string().describe("Google OAuth2 access token"),
      },
      async ({ url, access_token }) => {
        const result = await checkIndexStatus(url, access_token);
    
        let output = `## Indexing Status\n\n`;
        output += `**URL:** ${result.url}\n`;
        if (result.error) {
          output += `**Error:** ${result.error}\n`;
        } else {
          output += `**Last Notification:** ${result.lastCrawled || "Never"}\n`;
          output += `**Type:** ${result.type || "Unknown"}\n`;
        }
    
        return { content: [{ type: "text" as const, text: output }] };
      }
    );
  • The helper function 'checkIndexStatus' which performs the API call to the Google Indexing API.
    async function checkIndexStatus(
      url: string,
      accessToken: string
    ): Promise<{ url: string; lastCrawled?: string; type?: string; error?: string }> {
      try {
        const response = await fetch(
          `https://indexing.googleapis.com/v3/urlNotifications/metadata?url=${encodeURIComponent(url)}`,
          {
            headers: { Authorization: `Bearer ${accessToken}` },
            signal: AbortSignal.timeout(15000),
          }
        );
    
        if (!response.ok) {
          const data = await response.json();
          return { url, error: data.error?.message || `HTTP ${response.status}` };
        }
    
        const data = await response.json();
        return {
          url,
          lastCrawled: data.latestUpdate?.notifyTime || data.latestRemove?.notifyTime,
          type: data.latestUpdate ? "URL_UPDATED" : data.latestRemove ? "URL_DELETED" : "UNKNOWN",
        };
      } catch (error) {
        return {
          url,
          error: error instanceof Error ? error.message : "Unknown error",
        };

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/sharozdawa/indexnow-mcp'

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