Skip to main content
Glama

delete_webhook

Permanently delete a webhook subscription to stop future event deliveries. Use when retiring an integration or switching topics. Returns the deleted subscription ID or a no-op if not found.

Instructions

Permanently unsubscribe from an event topic by deleting the webhook subscription. Stops all future deliveries to that endpoint for that topic — irreversible (you'd have to re-create with create_webhook). Use when retiring an integration or switching topics. Returns the deleted GID, or a no-op message if nothing matched.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesWebhook subscription GID to delete.

Implementation Reference

  • The handler function for the 'delete_webhook' tool. It accepts an 'id' (webhook subscription GID), executes the WEBHOOK_DELETE_MUTATION GraphQL mutation, throws on user errors, and returns a success message with the deleted GID or a no-op message.
    server.tool(
      "delete_webhook",
      "Permanently unsubscribe from an event topic by deleting the webhook subscription. Stops all future deliveries to that endpoint for that topic — irreversible (you'd have to re-create with create_webhook). Use when retiring an integration or switching topics. Returns the deleted GID, or a no-op message if nothing matched.",
      deleteWebhookSchema,
      async (args) => {
        const data = await client.graphql<{
          webhookSubscriptionDelete: {
            deletedWebhookSubscriptionId: string | null;
            userErrors: ShopifyUserError[];
          };
        }>(WEBHOOK_DELETE_MUTATION, { id: args.id });
        throwIfUserErrors(
          data.webhookSubscriptionDelete.userErrors,
          "webhookSubscriptionDelete",
        );
        return {
          content: [
            {
              type: "text" as const,
              text: data.webhookSubscriptionDelete.deletedWebhookSubscriptionId
                ? `Deleted webhook ${data.webhookSubscriptionDelete.deletedWebhookSubscriptionId}.`
                : "No webhook matched; nothing deleted.",
            },
          ],
        };
      },
    );
  • The Zod schema for the 'delete_webhook' tool input. It defines a single required field: 'id' (string) described as the webhook subscription GID to delete.
    const deleteWebhookSchema = {
      id: z.string().describe("Webhook subscription GID to delete."),
    };
  • Registration of the 'delete_webhook' tool on the MCP server via server.tool(), called inside registerWebhookTools() which is invoked from src/server.ts line 66.
    server.tool(
      "delete_webhook",
      "Permanently unsubscribe from an event topic by deleting the webhook subscription. Stops all future deliveries to that endpoint for that topic — irreversible (you'd have to re-create with create_webhook). Use when retiring an integration or switching topics. Returns the deleted GID, or a no-op message if nothing matched.",
      deleteWebhookSchema,
      async (args) => {
        const data = await client.graphql<{
          webhookSubscriptionDelete: {
            deletedWebhookSubscriptionId: string | null;
            userErrors: ShopifyUserError[];
          };
        }>(WEBHOOK_DELETE_MUTATION, { id: args.id });
        throwIfUserErrors(
          data.webhookSubscriptionDelete.userErrors,
          "webhookSubscriptionDelete",
        );
        return {
          content: [
            {
              type: "text" as const,
              text: data.webhookSubscriptionDelete.deletedWebhookSubscriptionId
                ? `Deleted webhook ${data.webhookSubscriptionDelete.deletedWebhookSubscriptionId}.`
                : "No webhook matched; nothing deleted.",
            },
          ],
        };
      },
    );
  • src/server.ts:66-66 (registration)
    Where registerWebhookTools is called to register all webhook tools (including delete_webhook) on the MCP server instance.
    registerWebhookTools(s, shopify);
  • The WEBHOOK_DELETE_MUTATION GraphQL mutation used by the delete_webhook handler. It calls webhookSubscriptionDelete(id) and returns the deleted ID plus any user errors.
    const WEBHOOK_DELETE_MUTATION = /* GraphQL */ `
      mutation WebhookDelete($id: ID!) {
        webhookSubscriptionDelete(id: $id) {
          deletedWebhookSubscriptionId
          userErrors { field message }
        }
      }
    `;
Behavior4/5

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

Discloses destructive nature (permanent, irreversible), behavior (stops all future deliveries), and return format (deleted GID or no-op). No annotations, so description carries full burden and does so well, though lacks auth or rate limit info.

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

Conciseness5/5

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

Three sentences perfectly sized: main purpose, usage guideline, return behavior. No fluff, front-loaded.

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

Completeness5/5

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

All necessary information is present for a simple deletion tool: purpose, irreversibility, usage, return value. Sibling tools are distinct.

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 coverage is 100%, and the description adds no extra meaning beyond the schema's description of the 'id' parameter. Baseline score applies.

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?

Describes verb (delete/unsubscribe) and resource (webhook subscription) clearly, with explicit distinction from create_webhook for re-creation.

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

Usage Guidelines5/5

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

Provides explicit when-to-use scenarios ('retiring an integration or switching topics') and states irreversibility, implying when not to use. References alternative (create_webhook).

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/miller-joe/shopify-mcp'

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