Skip to main content
Glama
ExoCubeYT

OpenWA MCP Server

by ExoCubeYT

delete_webhook

Remove a webhook from a WhatsApp session by providing the session ID and webhook ID. Stops notifications from being sent to that webhook URL.

Instructions

Delete a webhook from a WhatsApp session

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sessionIdYesSession ID
webhookIdYesWebhook ID to delete

Implementation Reference

  • Handler function that executes the delete_webhook tool logic. It sends a DELETE request to the OpenWA API with the session ID and webhook ID.
      async ({ sessionId, webhookId }) => {
        const data = await openwaClient({
          method: "DELETE",
          path: `/sessions/${sessionId}/webhooks/${webhookId}`,
        });
        return { content: [{ type: "text" as const, text: JSON.stringify(data, null, 2) }] };
      }
    );
  • Schema and registration for the delete_webhook tool. Defines the input schema with sessionId (string) and webhookId (string) parameters.
    "delete_webhook",
    {
      description: "Delete a webhook from a WhatsApp session",
      inputSchema: {
        sessionId: z.string().describe("Session ID"),
        webhookId: z.string().describe("Webhook ID to delete"),
      },
    },
  • Registration of the delete_webhook tool via server.registerTool() within the registerWebhookTools function.
    server.registerTool(
      "delete_webhook",
      {
        description: "Delete a webhook from a WhatsApp session",
        inputSchema: {
          sessionId: z.string().describe("Session ID"),
          webhookId: z.string().describe("Webhook ID to delete"),
        },
      },
      async ({ sessionId, webhookId }) => {
        const data = await openwaClient({
          method: "DELETE",
          path: `/sessions/${sessionId}/webhooks/${webhookId}`,
        });
        return { content: [{ type: "text" as const, text: JSON.stringify(data, null, 2) }] };
      }
    );
  • The openwaClient helper function used by the handler to make the HTTP DELETE request to the backend API.
    export async function openwaClient<T = unknown>(opts: RequestOptions): Promise<T> {
      const url = `${BASE_URL}${opts.path}`;
    
      const headers: Record<string, string> = {
        "Content-Type": "application/json",
        "X-API-Key": API_KEY,
      };
    
      const res = await fetch(url, {
        method: opts.method,
        headers,
        body: opts.body ? JSON.stringify(opts.body) : undefined,
      });
    
      const text = await res.text();
    
      if (!res.ok) {
        throw new Error(`OpenWA API ${res.status}: ${text}`);
      }
    
      try {
        return JSON.parse(text) as T;
      } catch {
        return text as T;
      }
    }
  • src/index.ts:9-20 (registration)
    Import and invocation of registerWebhookTools which registers the delete_webhook tool on the MCP server.
    import { registerWebhookTools } from "./tools/webhooks.js";
    import { registerLabelTools } from "./tools/labels.js";
    import { registerMediaTools } from "./tools/media.js";
    
    const server = new McpServer({ name: "openwa-mcp", version: "1.0.0" });
    
    registerSessionTools(server);
    registerMessageTools(server);
    registerBulkTools(server);
    registerGroupTools(server);
    registerContactTools(server);
    registerWebhookTools(server);
Behavior2/5

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

With no annotations, the description must disclose behavioral traits. It only states the action is a deletion but gives no information about side effects, reversibility, permissions, or error handling.

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?

The description is a single sentence with no wasted words. It is concise and directly communicates the tool's purpose.

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?

Given the simple parameters and lack of output schema, the description lacks completeness. It doesn't mention expected outcomes, error states, or any behavioral nuances relevant to a deletion operation.

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?

The input schema covers 100% of parameters with descriptions, so the description adds no additional meaning beyond what the schema provides. 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 (webhook from a WhatsApp session). It distinguishes itself from sibling tools like create_webhook, update_webhook, and list_webhooks.

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?

The description provides no guidance on when to use this tool vs alternatives, no prerequisites, and no scenarios when not to use it. It simply states what it does without context.

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/ExoCubeYT/openwa-mcp'

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