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
| Name | Required | Description | Default |
|---|---|---|---|
| feedpath | Yes | The URL of the sitemap to add. For example: http://www.example.com/sitemap.xml | |
| siteUrl | Yes | The site's URL, including protocol. For example: http://www.example.com/ |
Implementation Reference
- src/schemas.ts:84-91 (schema)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), },
- src/index.ts:343-358 (handler)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), }, ], }; }
- src/search-console.ts:218-228 (handler)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!), }), ); }
- src/search-console.ts:8-8 (helper)Type alias for the SubmitSitemapRequest based on Google API types.type SubmitSitemapRequest = webmasters_v3.Params$Resource$Sitemaps$Submit;