Skip to main content
Glama
ggiraudon

Email MCP Server

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";
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states the action ('Deletes') but lacks critical details: whether this is irreversible, if it requires specific permissions, what happens to contained messages, or error conditions. For a destructive operation with zero annotation coverage, this is a significant gap.

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?

The description is a single, efficient sentence with zero wasted words. It's appropriately sized and front-loaded, directly stating the tool's purpose 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 this is a destructive operation with no annotations, no output schema, and minimal parameter documentation, the description is incomplete. It should address behavioral risks, permissions, or error handling to adequately support an agent in invoking this tool correctly.

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?

The description doesn't add any parameter-specific information beyond the input schema. With 0% schema description coverage and 1 parameter, the baseline is 3 since the schema alone defines the parameter ('folderName') with type and constraints, but the description doesn't compensate by explaining format or semantics.

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 ('Deletes') and resource ('a folder from the IMAP account'), providing specific verb+resource pairing. However, it doesn't differentiate from sibling tools like 'deleteMessage' or 'createFolder', which would require explicit comparison to achieve a perfect score.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. There's no mention of prerequisites (e.g., folder must exist), exclusions (e.g., cannot delete system folders), or comparisons to siblings like 'deleteMessage' or 'createFolder', leaving usage context unclear.

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

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