zulip_post_message
Post messages to Zulip channels with specified topics, enabling AI assistants to communicate in team workspaces through structured conversations.
Instructions
Post a new message to a Zulip channel (stream)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| channel_name | Yes | The name of the stream to post to | |
| topic | Yes | The topic within the stream | |
| content | Yes | The message content to post |
Implementation Reference
- index.ts:420-435 (handler)The main handler for the zulip_post_message tool in the CallToolRequest handler. Validates required arguments (channel_name, topic, content) and calls ZulipClient.sendStreamMessage to execute the tool logic.case "zulip_post_message": { const args = request.params.arguments as unknown as PostMessageArgs; if (!args.channel_name || !args.topic || !args.content) { throw new Error( "Missing required arguments: channel_name, topic, and content" ); } const response = await zulipClient.sendStreamMessage( args.channel_name, args.topic, args.content ); return { content: [{ type: "text", text: JSON.stringify(response) }], }; }
- index.ts:263-277 (helper)ZulipClient helper method that implements the core logic for posting a message to a Zulip stream using the zulip-js client.async sendStreamMessage(streamName: string, topic: string, content: string) { try { const params = { to: streamName, type: "stream", topic: topic, content: content, }; return await this.client.messages.send(params); } catch (error) { console.error("Error sending stream message:", error); throw error; } }
- index.ts:92-113 (schema)Tool schema definition including name, description, input properties, and required fields for the zulip_post_message tool.const postMessageTool: Tool = { name: "zulip_post_message", description: "Post a new message to a Zulip channel (stream)", inputSchema: { type: "object", properties: { channel_name: { type: "string", description: "The name of the stream to post to", }, topic: { type: "string", description: "The topic within the stream", }, content: { type: "string", description: "The message content to post", }, }, required: ["channel_name", "topic", "content"], }, };
- index.ts:537-548 (registration)Tool registration via the ListToolsRequest handler, which includes postMessageTool in the returned list of available tools.return { tools: [ listChannelsTool, postMessageTool, sendDirectMessageTool, addReactionTool, getChannelHistoryTool, getTopicsTool, subscribeToChannelTool, getUsersTool, ], };
- index.ts:35-39 (schema)TypeScript interface used for type-checking the tool's input arguments in the handler.interface PostMessageArgs { channel_name: string; topic: string; content: string; }