Skip to main content
Glama
billyfranklim1

mcp-evolution

Set Webhook

set_webhook

Configure WhatsApp webhook to send real-time events like messages and connection updates to your URL, with options for per-event requests and custom headers.

Instructions

Configure the webhook for the pinned WhatsApp instance.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
enabledYesEnable or disable the webhook
urlYesWebhook URL to receive events
byEventsNoSend separate requests per event type
base64NoSend media as base64 in webhook payload
eventsYesEvents to subscribe to. Examples: MESSAGES_UPSERT, MESSAGES_UPDATE, SEND_MESSAGE, CONNECTION_UPDATE, QRCODE_UPDATED, etc.
headersNoCustom HTTP headers to include in webhook requests

Implementation Reference

  • Zod schema for set_webhook input: defines enabled (boolean), url (string URL), byEvents (optional boolean), base64 (optional boolean), events (array of strings), headers (optional record of strings).
    import { z } from "zod";
    import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
    import { McpError } from "@modelcontextprotocol/sdk/types.js";
    import type { EvolutionClient } from "../evolution-client.js";
    
    const schema = {
      enabled: z.boolean().describe("Enable or disable the webhook"),
      url: z.string().url().describe("Webhook URL to receive events"),
      byEvents: z.boolean().optional().describe("Send separate requests per event type"),
      base64: z.boolean().optional().describe("Send media as base64 in webhook payload"),
      events: z.array(z.string()).describe(
        "Events to subscribe to. Examples: MESSAGES_UPSERT, MESSAGES_UPDATE, SEND_MESSAGE, CONNECTION_UPDATE, QRCODE_UPDATED, etc."
      ),
      headers: z.record(z.string()).optional().describe("Custom HTTP headers to include in webhook requests"),
    };
  • Handler function registerSetWebhook that registers the 'set_webhook' tool on the MCP server. Builds a webhook object from args and calls client.post(`/webhook/set/${instanceName}`, { webhook }) to configure the webhook for the pinned WhatsApp instance.
    export function registerSetWebhook(server: McpServer, client: EvolutionClient): void {
      server.registerTool(
        "set_webhook",
        {
          title: "Set Webhook",
          description: "Configure the webhook for the pinned WhatsApp instance.",
          inputSchema: schema,
        },
        async (args) => {
          try {
            const webhook: Record<string, unknown> = {
              enabled: args.enabled,
              url: args.url,
              events: args.events,
            };
            if (args.byEvents !== undefined) webhook["byEvents"] = args.byEvents;
            if (args.base64 !== undefined) webhook["base64"] = args.base64;
            if (args.headers !== undefined) webhook["headers"] = args.headers;
            const data = await client.post(`/webhook/set/${client.instanceName}`, { webhook });
            return { content: [{ type: "text" as const, text: JSON.stringify(data, null, 2) }] };
          } catch (e) {
            if (e instanceof McpError) return { isError: true, content: [{ type: "text" as const, text: e.message }] };
            throw e;
          }
        }
      );
    }
  • Import of registerSetWebhook from ./set-webhook.js
    import { registerFindWebhook } from "./find-webhook.js";
    import { registerSetWebhook } from "./set-webhook.js";
  • Registration call: registerSetWebhook(server, client) within registerAllTools
    // Webhook
    registerFindWebhook(server, client);
    registerSetWebhook(server, client);
Behavior2/5

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

With no annotations provided, the description must disclose behavioral traits. It only states 'Configure the webhook' without explaining whether this creates, updates, or replaces an existing webhook, what permissions are needed, or what side effects occur (e.g., overriding previous settings).

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 concise sentence that delivers the core purpose with no waste. However, it may be too brief for a complex tool, but it does not contain unnecessary information.

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 tool has 6 parameters including nested objects and no output schema, the description is too minimal. It does not explain the effect of changes, whether the webhook is immediately active, or what the response looks like. More context is needed for safe invocation.

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 does not need to add detail. The baseline of 3 is appropriate as the schema alone sufficiently documents parameter meaning.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses the verb 'Configure' and specifies the resource 'webhook for the pinned WhatsApp instance', which clearly indicates the tool's purpose. It distinguishes itself from sibling 'find_webhook' by implying modification rather than retrieval, though it could be more explicit.

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 versus alternatives like 'find_webhook'. It does not mention prerequisites, usage context, or situations where this tool should be avoided.

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/billyfranklim1/mcp-evolution'

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