Skip to main content
Glama

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
NameRequiredDescriptionDefault
channel_nameYesThe name of the stream to post to
topicYesThe topic within the stream
contentYesThe message content to post

Implementation Reference

  • 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) }],
      };
    }
  • 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,
    ],
  • 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;
      }
    }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Monadical-SAS/zulip-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server