# Delete Sitemap — Google Search Console

> Unlists a sitemap from a Google Search Console property. Destructive, and not reversible by this tool.

- Key: `google_search_console-delete-sitemap`
- Type: Action (Write)
- Version: 0.0.1
- App: Google Search Console (`google_search_console`) — https://pipedream.com/apps/google-search-console.md
- This page (HTML): https://pipedream.com/apps/google-search-console/actions/delete-sitemap
- Hints: destructive · open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/google_search_console/actions/delete-sitemap/delete-sitemap.mjs

## Description

Unlists a sitemap from a Google Search Console property. Destructive, and not reversible by this tool.

**Confirm before calling.** Only call it once the user has explicitly confirmed the exact `sitemapUrl`. If the ask is vague ("remove the old sitemap"), call **List Sitemaps** first, show the candidate paths and ask which one. If the user names a sitemap but has not confirmed the deletion, state the exact `sitemapUrl` you are about to delete and ask. Silence is not consent: if you cannot obtain an explicit confirmation in this turn (for example no confirmation prompt is available), end your turn by asking in plain text and do NOT call this tool. Never delete a sitemap as a side effect of another task, and never delete-and-resubmit to "refresh" one — **Submit Sitemap** on the existing path already does that.

**What this does NOT do.** It only UNLISTS the sitemap from Search Console. The pages it contained stay in Google's index and remain crawlable, and the sitemap file stays on the website. Do not offer this tool as a way to remove content from Google.

**Returns** `{ deleted: true, sitemapUrl }` — the API body is empty, so there is nothing else to report. To prove it is gone, call **List Sitemaps** with NO `sitemapUrl` and check the `path` is absent; asking for the deleted path directly returns 404 "'<url>' is not a submitted or a known sitemap.", which reads as an error.

**Mistakes.** Passing a path (`/sitemap.xml`) or a guessed URL instead of a `path` from **List Sitemaps** returns that same 404 — and so does the `https://www.` variant when the property lists the `http://` one, because host and scheme are part of the identity. Requires `siteOwner` or `siteFullUser`; a `siteRestrictedUser` gets 403.

[See the documentation](https://developers.google.com/webmaster-tools/v1/sitemaps/delete)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `siteUrl` | `string` | Yes | Exact property identifier from List Sites — sc-domain:example.com for a domain property, or a URL-prefix such as https://www.example.com/ (trailing slash; scheme and subdomain must match exactly, or the call 403s). Copy it verbatim, never construct it. For traffic questions prefer the domain property when one exists: it covers all subdomains and protocols. |
| `sitemapUrl` | `string` | Yes | Full URL of the sitemap to unlist, copied verbatim from the path field returned by List Sitemaps, e.g. https://www.example.com/sitemap.xml. An unknown path returns 404 "'<url>' is not a submitted or a known sitemap." Confirm this exact URL with the user before calling. |

## Run it

**MCP**

```ts
import { Client } from "@modelcontextprotocol/sdk/client/index.js"
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js"
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const accessToken = await pd.rawAccessToken

const transport = new StreamableHTTPClientTransport(
  new URL("https://remote.mcp.pipedream.net/v3"),
  {
    requestInit: {
      headers: {
        Authorization: `Bearer ${accessToken}`,
        "x-pd-project-id": process.env.PIPEDREAM_PROJECT_ID!,
        "x-pd-environment": "production",
        "x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
        "x-pd-app-slug": "google_search_console",
      },
    },
  },
)

const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)

const { tools } = await mcp.listTools()

// listTools() hands your model this tool's input schema, so it can
// fill the arguments itself:
const result = await mcp.callTool({
  name: "google_search_console-delete-sitemap",
  arguments: {
    siteUrl: "Property (siteUrl)",
    sitemapUrl: "Sitemap URL",
  },
})
```

**TypeScript**

```ts
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const result = await pd.actions.run({
  id: "google_search_console-delete-sitemap",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    google_search_console: { authProvisionId: "apn_xxxxxxx" },
    siteUrl: "Property (siteUrl)",
    sitemapUrl: "Sitemap URL",
  },
})

console.log(result)
```

**cURL**

```bash
curl -X POST https://api.pipedream.com/v1/connect/{project_id}/actions/run \
  -H "Content-Type: application/json" \
  -H "X-PD-Environment: production" \
  -H "Authorization: Bearer {access_token}" \
  -d '{
    "external_user_id": "{external_user_id}",
    "id": "google_search_console-delete-sitemap",
    "configured_props": {
      "google_search_console": { "authProvisionId": "apn_xxxxxxx" },
      "siteUrl": "Property (siteUrl)",
      "sitemapUrl": "Sitemap URL"
    }
  }'
```

---

- App: https://pipedream.com/apps/google-search-console.md · All apps: https://pipedream.com/apps
