Skip to main content
Glama
sharozdawa

indexnow-mcp

by sharozdawa

google_indexing_submit

Submit URLs to Google for fast crawling and indexing using the Indexing API. Specify URL_UPDATED for new/changed content or URL_DELETED for removed pages.

Instructions

Submit URLs to Google Indexing API for fast crawling and indexing. Requires a Google service account access token with Indexing API permissions.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlsYesList of URLs to submit
access_tokenYesGoogle OAuth2 access token with Indexing API scope
typeNoNotification type: URL_UPDATED (new/changed) or URL_DELETED (removed). Default: URL_UPDATED

Implementation Reference

  • Tool registration and handler for google_indexing_submit.
    server.tool(
      "google_indexing_submit",
      "Submit URLs to Google Indexing API for fast crawling and indexing. Requires a Google service account access token with Indexing API permissions.",
      {
        urls: z.array(z.string().url()).describe("List of URLs to submit"),
        access_token: z.string().describe("Google OAuth2 access token with Indexing API scope"),
        type: z
          .enum(["URL_UPDATED", "URL_DELETED"])
          .optional()
          .describe("Notification type: URL_UPDATED (new/changed) or URL_DELETED (removed). Default: URL_UPDATED"),
      },
      async ({ urls, access_token, type }) => {
        const results = await submitToGoogleIndexing(urls, access_token, type || "URL_UPDATED");
        const successful = results.filter((r) => r.success).length;
    
        let output = `## Google Indexing API Results\n\n`;
        output += `**URLs submitted:** ${urls.length}\n`;
        output += `**Successful:** ${successful}/${urls.length}\n`;
        output += `**Type:** ${type || "URL_UPDATED"}\n\n`;
    
        output += `| URL | Status | Result |\n|-----|--------|--------|\n`;
        for (const r of results) {
          const shortUrl = r.url.length > 60 ? r.url.substring(0, 57) + "..." : r.url;
          output += `| ${shortUrl} | ${r.status} | ${r.message} |\n`;
        }
    
        return { content: [{ type: "text" as const, text: output }] };
      }
    );
    
    // Tool: Check indexing status via Google Indexing API
    server.tool(
  • Helper function that performs the actual network request to the Google Indexing API.
    async function submitToGoogleIndexing(
      urls: string[],
      accessToken: string,
      type: "URL_UPDATED" | "URL_DELETED" = "URL_UPDATED"
    ): Promise<GoogleIndexResult[]> {
      const results: GoogleIndexResult[] = [];
    
      for (const url of urls) {
        try {
          const response = await fetch(GOOGLE_INDEXING_API_URL, {
            method: "POST",
            headers: {
              "Content-Type": "application/json",
              Authorization: `Bearer ${accessToken}`,
            },
            body: JSON.stringify({
              url,
              type,
            }),
            signal: AbortSignal.timeout(15000),
          });
    
          const data = await response.json();
    
          results.push({
            url,
            success: response.status >= 200 && response.status < 300,
            status: response.status,
            message: response.ok
              ? `Submitted (${type})`
              : data.error?.message || `HTTP ${response.status}`,
          });
        } catch (error) {
          results.push({
            url,
            success: false,

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