Skip to main content
Glama

sitemaps_delete

Remove a sitemap from Google Search Console by specifying the site URL and sitemap URL. Use this to clean up outdated or incorrect sitemaps.

Instructions

Delete a sitemap from Google Search Console.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
siteUrlYesThe site URL
feedpathYesThe URL of the sitemap to delete

Implementation Reference

  • The main handler for the 'sitemaps_delete' tool. It registers a server tool that accepts siteUrl and feedpath, calls the Google Webmasters API DELETE endpoint, and returns a success or error response.
    // ── sitemaps_delete ──
    server.tool(
      "sitemaps_delete",
      "Delete a sitemap from Google Search Console.",
      {
        siteUrl: z.string().describe("The site URL"),
        feedpath: z.string().describe("The URL of the sitemap to delete"),
      },
      async ({ siteUrl, feedpath }) => {
        try {
          const result = await apiCall(
            `${WEBMASTERS_BASE}/sites/${encodeSiteUrl(siteUrl)}/sitemaps/${encodeURIComponent(feedpath)}`,
            { method: "DELETE" },
          );
          return {
            content: [
              {
                type: "text" as const,
                text: result.ok
                  ? `Sitemap "${feedpath}" deleted successfully.`
                  : result.body,
              },
            ],
            isError: !result.ok,
          };
        } catch (e) {
          return errorResult(e);
        }
      },
    );
  • Input schema for sitemaps_delete: siteUrl (string) and feedpath (string), both required.
    {
      siteUrl: z.string().describe("The site URL"),
      feedpath: z.string().describe("The URL of the sitemap to delete"),
    },
  • src/index.ts:329-358 (registration)
    Tool registration via server.tool() with name 'sitemaps_delete' and description 'Delete a sitemap from Google Search Console.'
    // ── sitemaps_delete ──
    server.tool(
      "sitemaps_delete",
      "Delete a sitemap from Google Search Console.",
      {
        siteUrl: z.string().describe("The site URL"),
        feedpath: z.string().describe("The URL of the sitemap to delete"),
      },
      async ({ siteUrl, feedpath }) => {
        try {
          const result = await apiCall(
            `${WEBMASTERS_BASE}/sites/${encodeSiteUrl(siteUrl)}/sitemaps/${encodeURIComponent(feedpath)}`,
            { method: "DELETE" },
          );
          return {
            content: [
              {
                type: "text" as const,
                text: result.ok
                  ? `Sitemap "${feedpath}" deleted successfully.`
                  : result.body,
              },
            ],
            isError: !result.ok,
          };
        } catch (e) {
          return errorResult(e);
        }
      },
    );
  • encodeSiteUrl helper function used to encode the site URL in the API request path.
    function encodeSiteUrl(siteUrl: string): string {
      return encodeURIComponent(siteUrl);
    }
  • apiCall helper function that performs the HTTP fetch with OAuth bearer token, used to call the Google API.
    async function apiCall(
      url: string,
      options: RequestInit = {},
    ): Promise<{ ok: boolean; status: number; body: string }> {
      const token = await getAccessToken();
      const headers: Record<string, string> = {
        Authorization: `Bearer ${token}`,
        ...((options.headers as Record<string, string>) || {}),
      };
    
      const res = await fetch(url, { ...options, headers });
      const body = await res.text();
      return { ok: res.ok, status: res.status, body };
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The description only states the deletion action but does not disclose side effects, ownership requirements, or any behavioral details beyond the basic operation. Since no annotations are present, this is insufficient.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single 8-word sentence that is efficient and front-loaded, but it could benefit from slightly more context without becoming verbose.

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

Completeness2/5

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

For a destructive tool with no output schema or annotations, the description is too minimal. It lacks details on return values, error handling, or prerequisites, making it incomplete.

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?

Schema description coverage is 100%, providing basic definitions for both parameters ('The site URL' and 'The URL of the sitemap to delete'). The tool description adds no additional semantics, so baseline score of 3 is appropriate.

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 states the action 'Delete' and the resource 'a sitemap from Google Search Console', distinguishing it from sibling tools like sitemaps_get or sitemaps_submit.

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

Usage Guidelines2/5

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

No guidance is provided on when to use this tool versus alternatives, nor any prerequisites or context for usage.

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

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