Skip to main content
Glama

delete-message

Remove messages from Zulip workspaces by specifying their unique ID to manage content and maintain organized communication channels.

Instructions

Delete a message by its ID.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
message_idYesUnique ID of the message to delete

Implementation Reference

  • The MCP tool handler function for 'delete-message'. It takes message_id parameter and calls zulipClient.deleteMessage to perform the deletion, handling success/error responses.
    async ({ message_id }) => {
      try {
        await zulipClient.deleteMessage(message_id);
        return createSuccessResponse(`Message ${message_id} deleted successfully!`);
      } catch (error) {
        return createErrorResponse(`Error deleting message: ${error instanceof Error ? error.message : 'Unknown error'}`);
      }
    }
  • src/server.ts:516-527 (registration)
    Registration of the 'delete-message' MCP tool with server.tool(), specifying name, description, input schema, and handler function.
      "delete-message",
      "Delete a message by its ID.",
      DeleteMessageSchema.shape,
      async ({ message_id }) => {
        try {
          await zulipClient.deleteMessage(message_id);
          return createSuccessResponse(`Message ${message_id} deleted successfully!`);
        } catch (error) {
          return createErrorResponse(`Error deleting message: ${error instanceof Error ? error.message : 'Unknown error'}`);
        }
      }
    );
  • Zod schema defining the input parameters for the delete-message tool: requires a numeric message_id.
    export const DeleteMessageSchema = z.object({
      message_id: z.number().describe("Unique ID of the message to delete")
    });
  • ZulipClient helper method that performs the actual HTTP DELETE request to Zulip API endpoint /messages/{messageId} to delete the message.
    async deleteMessage(messageId: number): Promise<void> {
      await this.client.delete(`/messages/${messageId}`);
    }

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