Update Block Status
update_block_statusBlock or unblock a WhatsApp contact by specifying their phone number or JID and the desired status.
Instructions
Block or unblock a WhatsApp contact via the pinned instance.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| number | Yes | Recipient JID or phone number (e.g. 5511999999999 or group@g.us) | |
| status | Yes | block: block the contact; unblock: unblock the contact |
Implementation Reference
- src/tools/update-block-status.ts:12-33 (handler)Handler function that registers the 'update_block_status' MCP tool. It calls Evolution API endpoint /chat/updateBlockStatus/{instanceName} with number and status (block/unblock) parameters.
export function registerUpdateBlockStatus(server: McpServer, client: EvolutionClient): void { server.registerTool( "update_block_status", { title: "Update Block Status", description: "Block or unblock a WhatsApp contact via the pinned instance.", inputSchema: schema, }, async (args) => { try { const data = await client.post(`/chat/updateBlockStatus/${client.instanceName}`, { number: args.number, status: args.status, }); 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; } } ); } - Input schema defining the 'number' parameter (phone or JID) and 'status' parameter (enum: block/unblock) for the tool.
const schema = { number: PhoneOrJidSchema, status: z.enum(["block", "unblock"]).describe("block: block the contact; unblock: unblock the contact"), }; - src/tools/index.ts:146-148 (registration)Registration call that wires the update_block_status tool into the MCP server via registerAllTools().
registerUpdateBlockStatus(server, client); registerCheckNumber(server, client); } - src/schemas.ts:8-11 (helper)Shared Zod schema for phone number or JID, used by the 'number' parameter of update_block_status.
export const PhoneOrJidSchema = z .string() .min(1) .describe("Recipient JID or phone number (e.g. 5511999999999 or group@g.us)");