Skip to main content
Glama

create-scheduled-message

Schedule a Zulip message for future delivery in a stream or as a direct message. Specify the channel or recipients, content, and delivery timestamp.

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

  • MCP tool handler that receives validated input, calls the Zulip client to schedule a message, and returns success/error response.
    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'}`);
        }
  • Zod schema defining the input validation for the create-scheduled-message tool: type (stream/direct), to (string), content (string), optional topic, and scheduled_delivery_timestamp (number).
    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:13-22 (registration)
    Import of CreateScheduledMessageSchema into server.ts, enabling registration of the tool.
    import { 
      ZulipConfig,
      SendMessageSchema,
      GetMessagesSchema,
      UploadFileSchema,
      EditMessageSchema,
      AddReactionSchema,
      RemoveReactionSchema,
      CreateScheduledMessageSchema,
      EditScheduledMessageSchema,
  • ZulipClient helper method that maps the MCP tool's parameters to the Zulip API format (converts 'direct' to 'private', handles recipient parsing) and POSTs to /scheduled_messages.
    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;
    }
  • TypeScript type inferred from the schema for type-safe usage.
    export type CreateScheduledMessageParams = z.infer<typeof CreateScheduledMessageSchema>;
Behavior2/5

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

No annotations provided, so description carries full burden. It only states it schedules a message at a future time, but lacks details on behavior like whether messages are editable, cancelable, or any side effects. Minimal disclosure for a scheduling tool.

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?

Two sentences, no redundant words, front-loaded with the main purpose. Every part adds value without unnecessary elaboration.

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

Completeness2/5

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

Given no annotations and no output schema, the description is too thin. It does not explain post-scheduling behavior (confirmation, errors), timezone handling, or relationship with sibling tools like edit-scheduled-message. Users need more context for correct use.

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?

Input schema covers all parameters with 100% description coverage. The description adds context for the 'to' parameter (comma-separated emails and resource hint), but no additional semantics for other parameters. Baseline 3 with slight improvement.

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?

Description clearly states it schedules a future message, with a specific verb and resource. It implicitly distinguishes from 'send-message' (immediate) and 'edit-scheduled-message' (edit), but does not explicitly differentiate from siblings.

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

Usage Guidelines3/5

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

Provides guidance for the 'to' parameter (comma-separated emails for direct, reference to users-directory resource), but does not explain when to use this tool versus alternatives like 'send-message' (for immediate sending) or 'edit-scheduled-message'.

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