Skip to main content
Glama
ggiraudon
by ggiraudon

deleteFolder

Remove unwanted folders from your IMAP email account to organize your mailbox and manage storage efficiently.

Instructions

Deletes a folder from the IMAP account.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
folderNameYes

Implementation Reference

  • The execute function of the DeleteFolderTool that implements the core logic: validates input, obtains IMAP controller instance, connects, deletes the folder, and returns success.
    async execute(args, context) { if (!args || typeof args !== 'object' || !('folderName' in args)) { throw new Error("Missing required arguments"); } const controller = ImapControllerFactory.getInstance(); await controller.connect(); await controller.deleteFolder(args.folderName); return JSON.stringify({ success: true }); }
  • Zod schema defining the input for the deleteFolder tool: folderName as string between 2-100 chars.
    export const DeleteFolderInput = z.object({ folderName: z.string().min(2).max(100) });
  • src/index.ts:48-48 (registration)
    Registers the DeleteFolderTool with the FastMCP server.
    server.addTool(DeleteFolderTool);
  • ImapController method that performs the actual folder deletion via imap.delBox callback.
    deleteFolder(folderName: string): Promise<void> { return new Promise((resolve, reject) => { this.imap.delBox(folderName, (err: Error | null) => { if (err) return reject(err); resolve(); }); }); }
  • src/index.ts:8-8 (registration)
    Import statement for DeleteFolderTool used in registration.
    import { DeleteFolderTool } from "./tools/DeleteFolderTool.js";

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/ggiraudon/emailMCPServer'

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