Skip to main content
Glama
ahonn

Google Search Console MCP Server

by ahonn

submit_sitemap

Submit a sitemap URL to Google Search Console to notify Google about your website's structure and content for improved indexing and search visibility.

Instructions

Submit a sitemap for a site in Google Search Console

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
feedpathYesThe URL of the sitemap to add. For example: http://www.example.com/sitemap.xml
siteUrlYesThe site's URL, including protocol. For example: http://www.example.com/

Implementation Reference

  • Zod input schema definition for the submit_sitemap tool, defining siteUrl and feedpath parameters.
    export const SubmitSitemapSchema = z.object({ feedpath: z .string() .describe('The URL of the sitemap to add. For example: http://www.example.com/sitemap.xml'), siteUrl: z .string() .describe("The site's URL, including protocol. For example: http://www.example.com/"), });
  • src/index.ts:78-82 (registration)
    Registration of the submit_sitemap tool in the ListTools response, including name, description, and input schema reference.
    { name: 'submit_sitemap', description: 'Submit a sitemap for a site in Google Search Console', inputSchema: zodToJsonSchema(SubmitSitemapSchema), },
  • Main MCP tool handler for submit_sitemap: parses input with schema, constructs request body, delegates to SearchConsoleService.submitSitemap, and formats response.
    case 'submit_sitemap': { const args = SubmitSitemapSchema.parse(request.params.arguments); const requestBody = { siteUrl: args.siteUrl, feedpath: args.feedpath, }; const response = await searchConsole.submitSitemap(requestBody); return { content: [ { type: 'text', text: JSON.stringify(response.data, null, 2), }, ], }; }
  • Core implementation in SearchConsoleService: calls Google Webmasters API sitemaps.submit with permission error handling and URL normalization fallback.
    async submitSitemap(requestBody: SubmitSitemapRequest) { const webmasters = await this.getWebmasters(); return this.handlePermissionError( () => webmasters.sitemaps.submit(requestBody), () => webmasters.sitemaps.submit({ ...requestBody, siteUrl: this.normalizeUrl(requestBody.siteUrl!), }), ); }
  • Type alias for the SubmitSitemapRequest based on Google API types.
    type SubmitSitemapRequest = webmasters_v3.Params$Resource$Sitemaps$Submit;

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/ahonn/mcp-server-gsc'

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