zulip_post_message
Send messages to Zulip channels with specified topics to communicate within team workspaces.
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)Executes the zulip_post_message tool by validating input arguments (channel_name, topic, content), calling the ZulipClient's sendStreamMessage method, and returning the JSON-stringified response.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:92-113 (schema)Defines the Tool metadata for zulip_post_message, including name, description, and input schema with required properties channel_name, topic, and content.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:539-547 (registration)Registers the zulip_post_message tool (as postMessageTool) in the list of tools returned by the ListToolsRequest handler.listChannelsTool, postMessageTool, sendDirectMessageTool, addReactionTool, getChannelHistoryTool, getTopicsTool, subscribeToChannelTool, getUsersTool, ],
- index.ts:263-277 (helper)ZulipClient helper method that constructs the message parameters and calls the Zulip JS client's messages.send to post the message to the specified stream and topic.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; } }