Skip to main content
Glama

edit-scheduled-message

Modify scheduled messages in Zulip before delivery by updating recipients, content, topic, or timing.

Instructions

Modify a scheduled message before it's sent. For direct messages, use comma-separated email addresses or get user info from the users-directory resource (zulip://users).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
scheduled_message_idYesUnique scheduled message ID to edit
typeNoMessage type
toNoRecipients (channel name or comma-separated emails)
contentNoNew message content
topicNoNew topic for stream messages
scheduled_delivery_timestampNoNew delivery timestamp

Implementation Reference

  • The inline async handler function for the 'edit-scheduled-message' tool. It destructures input params, filters undefined values using filterUndefined, validates at least one param, calls zulipClient.editScheduledMessage, and returns formatted success/error responses.
    async ({ scheduled_message_id, type, to, content, topic, scheduled_delivery_timestamp }) => {
      try {
        const updateParams = filterUndefined({
          type,
          to,
          content,
          topic,
          scheduled_delivery_timestamp
        });
        if (Object.keys(updateParams).length === 0) {
          return createErrorResponse('At least one parameter must be provided to update scheduled message');
        }
        await zulipClient.editScheduledMessage(scheduled_message_id, updateParams);
        return createSuccessResponse(`Scheduled message ${scheduled_message_id} updated successfully!`);
      } catch (error) {
        return createErrorResponse(`Error editing scheduled message: ${error instanceof Error ? error.message : 'Unknown error'}`);
      }
    }
  • Zod schema defining and validating the input parameters for the edit-scheduled-message tool, including scheduled_message_id (required) and optional fields for type, to, content, topic, scheduled_delivery_timestamp.
    export const EditScheduledMessageSchema = z.object({
      scheduled_message_id: z.number().describe("Unique scheduled message ID to edit"),
      type: z.enum(["stream", "direct"]).optional().describe("Message type"),
      to: z.string().optional().describe("Recipients (channel name or comma-separated emails)"),
      content: z.string().optional().describe("New message content"),
      topic: z.string().optional().describe("New topic for stream messages"),
      scheduled_delivery_timestamp: z.number().optional().describe("New delivery timestamp")
    });
  • src/server.ts:664-686 (registration)
    Registration of the 'edit-scheduled-message' MCP tool via server.tool(), providing name, description, schema, and handler function.
    server.tool(
      "edit-scheduled-message",
      "Modify a scheduled message before it's sent. For direct messages, use comma-separated email addresses or get user info from the users-directory resource (zulip://users).",
      EditScheduledMessageSchema.shape,
      async ({ scheduled_message_id, type, to, content, topic, scheduled_delivery_timestamp }) => {
        try {
          const updateParams = filterUndefined({
            type,
            to,
            content,
            topic,
            scheduled_delivery_timestamp
          });
          if (Object.keys(updateParams).length === 0) {
            return createErrorResponse('At least one parameter must be provided to update scheduled message');
          }
          await zulipClient.editScheduledMessage(scheduled_message_id, updateParams);
          return createSuccessResponse(`Scheduled message ${scheduled_message_id} updated successfully!`);
        } catch (error) {
          return createErrorResponse(`Error editing scheduled message: ${error instanceof Error ? error.message : 'Unknown error'}`);
        }
      }
    );
  • ZulipClient helper method that implements the core logic for editing a scheduled message by filtering undefined params and making a PATCH request to Zulip's /scheduled_messages/{id} API endpoint.
    async editScheduledMessage(scheduledMessageId: number, params: {
      type?: 'stream' | 'direct';
      to?: string;
      content?: string;
      topic?: string;
      scheduled_delivery_timestamp?: number;
    }): Promise<void> {
      // Filter out undefined values
      const filteredParams = Object.fromEntries(
        Object.entries(params).filter(([, value]) => value !== undefined)
      );
      await this.client.patch(`/scheduled_messages/${scheduledMessageId}`, filteredParams);
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It mentions modifying a scheduled message 'before it's sent', which hints at timing constraints, but lacks details on permissions, error handling, rate limits, or what happens if modification fails. For a mutation tool with zero annotation coverage, this is insufficient.

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

Conciseness4/5

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

The description is concise with two sentences, front-loading the core purpose. The second sentence provides specific guidance for direct messages, which is useful but could be integrated more seamlessly. No wasted words, though slight structural improvement is possible.

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 6 parameters with full schema coverage and no output schema, the description is moderately complete but lacks behavioral context for a mutation tool. It covers basic purpose and some usage hints but misses details on permissions, side effects, or response format, which are critical for an edit operation without annotations.

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 6 parameters thoroughly. The description adds minimal value by clarifying 'comma-separated email addresses' for the 'to' parameter in direct messages, but this is largely redundant with the schema's description. Baseline 3 is appropriate as the schema does the heavy lifting.

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 action ('Modify a scheduled message') and resource ('scheduled message'), distinguishing it from sibling tools like edit-message or edit-draft. However, it doesn't explicitly differentiate from create-scheduled-message beyond the 'before it's sent' qualifier, which is implied by 'scheduled'.

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?

The description provides some context with 'For direct messages, use comma-separated email addresses or get user info from the users-directory resource', which implies usage patterns. However, it doesn't explicitly state when to use this tool versus alternatives like edit-message or create-scheduled-message, nor does it mention prerequisites or exclusions.

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