Skip to main content
Glama

create-scheduled-message

Schedule messages to send later in Zulip channels or private conversations by specifying delivery time and recipient details.

Instructions

Schedule a message to be sent at a future time. For direct messages, use comma-separated email addresses or get user info from the users-directory resource (zulip://users).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
typeYesMessage type: 'stream' for channels, 'direct' for private messages
toYesFor streams: channel name (e.g., 'general'). For direct: comma-separated user emails (e.g., 'user@example.com,user2@example.com')
contentYesMessage content with Markdown formatting
topicNoTopic for stream messages
scheduled_delivery_timestampYesUnix timestamp when message should be sent (seconds since epoch)

Implementation Reference

  • The main handler function for the 'create-scheduled-message' MCP tool. It calls the ZulipClient, handles the response, and formats MCP-compliant success/error messages.
    async ({ type, to, content, topic, scheduled_delivery_timestamp }) => {
      try {
        const result = await zulipClient.createScheduledMessage({
          type,
          to,
          content,
          topic,
          scheduled_delivery_timestamp
        });
        return createSuccessResponse(JSON.stringify({
          success: true,
          scheduled_message_id: result.scheduled_message_id,
          delivery_time: new Date(scheduled_delivery_timestamp * 1000).toISOString(),
          message: `Message scheduled successfully! ID: ${result.scheduled_message_id}`
        }, null, 2));
      } catch (error) {
        return createErrorResponse(`Error creating scheduled message: ${error instanceof Error ? error.message : 'Unknown error'}`);
      }
    }
  • Zod schema defining the input parameters and validation for the create-scheduled-message tool.
    export const CreateScheduledMessageSchema = z.object({
      type: z.enum(["stream", "direct"]).describe("Message type: 'stream' for channels, 'direct' for private messages"),
      to: z.string().describe("For streams: channel name (e.g., 'general'). For direct: comma-separated user emails (e.g., 'user@example.com,user2@example.com')"),
      content: z.string().describe("Message content with Markdown formatting"),
      topic: z.string().optional().describe("Topic for stream messages"),
      scheduled_delivery_timestamp: z.number().describe("Unix timestamp when message should be sent (seconds since epoch)")
    });
  • src/server.ts:639-662 (registration)
    Registration of the 'create-scheduled-message' tool with the MCP server, specifying name, description, input schema, and handler function.
    server.tool(
      "create-scheduled-message",
      "Schedule a message to be sent at a future time. For direct messages, use comma-separated email addresses or get user info from the users-directory resource (zulip://users).",
      CreateScheduledMessageSchema.shape,
      async ({ type, to, content, topic, scheduled_delivery_timestamp }) => {
        try {
          const result = await zulipClient.createScheduledMessage({
            type,
            to,
            content,
            topic,
            scheduled_delivery_timestamp
          });
          return createSuccessResponse(JSON.stringify({
            success: true,
            scheduled_message_id: result.scheduled_message_id,
            delivery_time: new Date(scheduled_delivery_timestamp * 1000).toISOString(),
            message: `Message scheduled successfully! ID: ${result.scheduled_message_id}`
          }, null, 2));
        } catch (error) {
          return createErrorResponse(`Error creating scheduled message: ${error instanceof Error ? error.message : 'Unknown error'}`);
        }
      }
    );
  • ZulipClient helper method that performs the actual HTTP API call to Zulip's /scheduled_messages endpoint to create the scheduled message.
    async createScheduledMessage(params: {
      type: 'stream' | 'direct';
      to: string;
      content: string;
      topic?: string;
      scheduled_delivery_timestamp: number;
    }): Promise<{ scheduled_message_id: number }> {
      // Convert our types to Zulip API types
      const zulipType = params.type === 'direct' ? 'private' : 'stream';
      
      const payload: any = {
        type: zulipType,
        content: params.content,
        scheduled_delivery_timestamp: params.scheduled_delivery_timestamp
      };
    
      // Handle recipients based on message type
      if (params.type === 'direct') {
        // For private messages, 'to' should be JSON array of user emails/IDs
        const recipients = params.to.split(',').map(email => email.trim());
        payload.to = JSON.stringify(recipients);
      } else {
        // For stream messages, 'to' is the stream name
        payload.to = params.to;
        if (params.topic) {
          payload.topic = params.topic;
        }
      }
    
      const response = await this.client.post('/scheduled_messages', payload, {
        headers: {
          'Content-Type': 'application/x-www-form-urlencoded'
        },
        transformRequest: [(data) => {
          const params = new URLSearchParams();
          for (const key in data) {
            if (data[key] !== undefined) {
              params.append(key, String(data[key]));
            }
          }
          return params.toString();  // Return string, not URLSearchParams object
        }]
      });
      return response.data;
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool schedules messages for future delivery but doesn't mention important behavioral traits like whether scheduling requires specific permissions, what happens if the timestamp is in the past, whether scheduled messages can be canceled, or what the response format looks like. For a mutation tool with zero annotation coverage, this leaves significant gaps in understanding its behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized with two concise sentences that front-load the core purpose. Every sentence earns its place: the first establishes the main function, and the second provides specific guidance for direct messages. There's no wasted text or redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given this is a mutation tool with no annotations and no output schema, the description should provide more complete context about behavioral aspects. While it adequately explains what the tool does and provides some usage guidance, it lacks information about permissions, error conditions, response format, and limitations. The 100% schema coverage helps with parameters, but the overall context remains incomplete for a scheduling operation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all 5 parameters thoroughly. The description adds minimal value beyond the schema by mentioning 'comma-separated email addresses' for direct messages, which is already covered in the schema's 'to' parameter description. No additional parameter semantics are provided beyond what the structured schema offers.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose as 'Schedule a message to be sent at a future time,' which is a specific verb+resource combination. It distinguishes itself from sibling tools like 'send-message' by focusing on future scheduling rather than immediate sending. However, it doesn't explicitly contrast with 'edit-scheduled-message' for modifying existing scheduled messages.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context for direct messages by specifying 'use comma-separated email addresses or get user info from the users-directory resource.' It distinguishes between 'stream' and 'direct' message types, which helps guide usage. However, it doesn't explicitly state when NOT to use this tool (e.g., for immediate sending use 'send-message') or mention alternatives like 'edit-scheduled-message' for modifications.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/avisekrath/zulip-mcp-server'

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