edit-scheduled-message
Change the content, recipients, topic, or delivery time of a scheduled message using its unique ID. Supports stream and direct messages in Zulip workspaces.
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
| Name | Required | Description | Default |
|---|---|---|---|
| content | No | New message content | |
| scheduled_delivery_timestamp | No | New delivery timestamp | |
| scheduled_message_id | Yes | Unique scheduled message ID to edit | |
| to | No | Recipients (channel name or comma-separated emails) | |
| topic | No | New topic for stream messages | |
| type | No | Message type |
Implementation Reference
- src/server.ts:664-686 (handler)MCP tool registration and inline handler function for 'edit-scheduled-message'. Validates input, filters parameters, calls ZulipClient.editScheduledMessage, and formats MCP-compliant response.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'}`); } } );
- src/types.ts:220-227 (schema)Zod schema defining the input parameters and validation for the 'edit-scheduled-message' tool.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/zulip/client.ts:296-308 (helper)ZulipClient helper method that executes the actual Zulip API PATCH request to update the scheduled message.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); }