zulip_send_direct_message
Send direct messages to specific users in Zulip workspaces by specifying recipient email addresses or user IDs and message content.
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)Handler logic for the 'zulip_send_direct_message' tool: parses arguments, validates them, calls the ZulipClient's sendDirectMessage method, and returns the response.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)Schema definition for the 'zulip_send_direct_message' tool, including input schema, required fields, and description.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:538-547 (registration)Registration of the 'zulip_send_direct_message' tool (as sendDirectMessageTool) in the list of available tools returned by ListToolsRequest.tools: [ listChannelsTool, postMessageTool, sendDirectMessageTool, addReactionTool, getChannelHistoryTool, getTopicsTool, subscribeToChannelTool, getUsersTool, ],
- index.ts:279-292 (helper)Helper method in ZulipClient class that performs the actual API call to send a direct message via Zulip.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; } }
- index.ts:41-44 (schema)TypeScript interface defining the arguments for the send direct message tool.interface SendDirectMessageArgs { recipients: string[]; content: string; }