zulip_send_direct_message
Send direct messages to specific users in Zulip workspaces using email addresses or user IDs for private communication.
Instructions
Send a direct message to one or more users
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| recipients | Yes | Email addresses or user IDs of recipients | |
| content | Yes | The message content to send |
Implementation Reference
- index.ts:437-451 (handler)MCP tool handler switch case that processes the zulip_send_direct_message request by calling the ZulipClient's sendDirectMessage method with validated arguments.case "zulip_send_direct_message": { const args = request.params.arguments as unknown as SendDirectMessageArgs; if (!args.recipients || !args.content) { throw new Error( "Missing required arguments: recipients and content" ); } const response = await zulipClient.sendDirectMessage( args.recipients, args.content ); return { content: [{ type: "text", text: JSON.stringify(response) }], }; }
- index.ts:115-135 (schema)Tool definition including name, description, and input schema for validation.const sendDirectMessageTool: Tool = { name: "zulip_send_direct_message", description: "Send a direct message to one or more users", inputSchema: { type: "object", properties: { recipients: { type: "array", items: { type: "string", }, description: "Email addresses or user IDs of recipients", }, content: { type: "string", description: "The message content to send", }, }, required: ["recipients", "content"], }, };
- index.ts:279-292 (helper)ZulipClient method that performs the actual API call to send a direct message using the Zulip JS client.async sendDirectMessage(recipients: string[], content: string) { try { const params = { to: recipients, type: "private", content: content, }; return await this.client.messages.send(params); } catch (error) { console.error("Error sending direct message:", error); throw error; } }