Skip to main content
Glama
ExoCubeYT

OpenWA MCP Server

by ExoCubeYT

update_webhook

Update an existing webhook by providing session ID and webhook ID. Specify new URL, event types, or signing secret.

Instructions

Update an existing webhook configuration

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sessionIdYesSession ID
webhookIdYesWebhook ID to update
urlNoNew webhook endpoint URL
eventsNoUpdated event types
secretNoUpdated signing secret

Implementation Reference

  • The handler function for the 'update_webhook' tool. It sends a PUT request to the OpenWA API with sessionId, webhookId, url, events, and secret to update an existing webhook configuration.
    async ({ sessionId, webhookId, url, events, secret }) => {
      const data = await openwaClient({
        method: "PUT",
        path: `/sessions/${sessionId}/webhooks/${webhookId}`,
        body: { url, events, secret },
      });
      return { content: [{ type: "text" as const, text: JSON.stringify(data, null, 2) }] };
    }
  • The Zod input schema for the 'update_webhook' tool. Defines sessionId (required), webhookId (required), and optional fields: url, events (array of strings), and secret.
    inputSchema: {
      sessionId: z.string().describe("Session ID"),
      webhookId: z.string().describe("Webhook ID to update"),
      url: z.string().optional().describe("New webhook endpoint URL"),
      events: z.array(z.string()).optional().describe("Updated event types"),
      secret: z.string().optional().describe("Updated signing secret"),
    },
  • The registration of the 'update_webhook' tool via server.registerTool() inside the registerWebhookTools function.
    server.registerTool(
      "update_webhook",
      {
        description: "Update an existing webhook configuration",
        inputSchema: {
          sessionId: z.string().describe("Session ID"),
          webhookId: z.string().describe("Webhook ID to update"),
          url: z.string().optional().describe("New webhook endpoint URL"),
          events: z.array(z.string()).optional().describe("Updated event types"),
          secret: z.string().optional().describe("Updated signing secret"),
        },
      },
      async ({ sessionId, webhookId, url, events, secret }) => {
        const data = await openwaClient({
          method: "PUT",
          path: `/sessions/${sessionId}/webhooks/${webhookId}`,
          body: { url, events, secret },
        });
        return { content: [{ type: "text" as const, text: JSON.stringify(data, null, 2) }] };
      }
    );
  • The openwaClient helper function used by the handler to make HTTP requests to the OpenWA 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:20-21 (registration)
    Where registerWebhookTools is called to wire up all webhook tools (including update_webhook) to the MCP server.
    registerWebhookTools(server);
    registerLabelTools(server);
Behavior2/5

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

No annotations are provided, so the description carries full burden. It only states 'Update an existing webhook configuration' without disclosing side effects, required permissions, or immediate effects. This is insufficient for a mutation tool.

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

Conciseness3/5

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

The description is a single sentence, which is concise. However, it is too minimal and lacks structure; it could benefit from additional detail 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?

The tool has no output schema and no annotations. The description does not mention return values, success/failure behavior, or what happens after an update. For a mutation tool, this leaves significant gaps.

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?

With 100% schema description coverage, the schema already documents each parameter. The description adds no extra meaning beyond the schema, 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.

Purpose4/5

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

The description clearly identifies the verb 'Update' and the resource 'webhook configuration', distinguishing it from siblings like create_webhook, delete_webhook, and list_webhooks. However, it could be more specific about which fields can be updated.

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 on when to use this tool versus alternatives, such as creating a new webhook or deleting one. There is no mention of prerequisites (e.g., existing webhook ID) or scenarios where update is preferable.

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