Skip to main content
Glama
ExoCubeYT

OpenWA MCP Server

by ExoCubeYT

unblock_contact

Unblock a previously blocked WhatsApp contact by providing session ID and contact ID.

Instructions

Unblock a previously blocked WhatsApp contact

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sessionIdYesSession ID
contactIdYesContact ID to unblock

Implementation Reference

  • The handler function that executes the 'unblock_contact' tool logic. It sends a POST request to /sessions/{sessionId}/contacts/{contactId}/unblock via the openwaClient helper.
    async ({ sessionId, contactId }) => {
      const data = await openwaClient({ method: "POST", path: `/sessions/${sessionId}/contacts/${contactId}/unblock` });
      return { content: [{ type: "text" as const, text: JSON.stringify(data, null, 2) }] };
    }
  • Input schema definition for the 'unblock_contact' tool. Requires sessionId (string) and contactId (string).
    {
      description: "Unblock a previously blocked WhatsApp contact",
      inputSchema: {
        sessionId: z.string().describe("Session ID"),
        contactId: z.string().describe("Contact ID to unblock"),
      },
    },
  • Registration of the 'unblock_contact' tool via server.registerTool() inside registerContactTools().
    server.registerTool(
      "unblock_contact",
      {
        description: "Unblock a previously blocked WhatsApp contact",
        inputSchema: {
          sessionId: z.string().describe("Session ID"),
          contactId: z.string().describe("Contact ID to unblock"),
        },
      },
      async ({ sessionId, contactId }) => {
        const data = await openwaClient({ method: "POST", path: `/sessions/${sessionId}/contacts/${contactId}/unblock` });
        return { content: [{ type: "text" as const, text: JSON.stringify(data, null, 2) }] };
      }
    );
  • src/index.ts:19-22 (registration)
    Where registerContactTools is called, which registers the tool on the MCP server.
    registerContactTools(server);
    registerWebhookTools(server);
    registerLabelTools(server);
    registerMediaTools(server);
  • The openwaClient helper function used by the handler to make HTTP requests to the OpenWA 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;
      }
    }
Behavior2/5

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

No annotations provided, so description must cover safety and side effects. Only states 'Unblock a previously blocked contact' without disclosing idempotency, error handling (e.g., if already unblocked), or permissions needed.

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?

Single sentence is concise. However, it could be structured with more detail (e.g., separate line for precondition) without sacrificing brevity.

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

Completeness3/5

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

Adequate for a simple tool. However, no output schema or mention of return value. Could include note on what happens on success/failure.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% with basic field descriptions. The description adds the key context that the contact was 'previously blocked', which reinforces the tool's purpose beyond the schema.

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?

Description clearly states the verb 'Unblock' and resource 'WhatsApp contact'. It directly conveys the action of reversing a previous block, distinguishing it from sibling tool 'block_contact'.

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

Usage Guidelines3/5

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

No guidance on when to use or prerequisites. It's straightforward, but could mention that the contact must be currently blocked. No alternatives discussed.

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