Skip to main content
Glama
ggiraudon

Email MCP Server

by ggiraudon

createFolder

Create a new folder in your IMAP email account to organize messages and improve email management.

Instructions

Creates a new folder in the IMAP account.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
folderNameYes

Implementation Reference

  • The main tool implementation including the execute handler that uses ImapController to create the folder.
    export const CreateFolderTool: Tool<any, typeof CreateFolderInput> = {
      name: "createFolder",
      description: "Creates a new folder in the IMAP account.",
      parameters: CreateFolderInput,
      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.createFolder(args.folderName);
        return JSON.stringify({ success: true });
      }
    };
  • Zod schema defining the input for the createFolder tool (folderName string).
    export const CreateFolderInput = z.object({
      folderName: z.string().min(2).max(100)
    });
  • src/index.ts:47-47 (registration)
    Registration of the CreateFolderTool with the FastMCP server.
    server.addTool(CreateFolderTool);
  • Helper method in ImapController that performs the actual IMAP folder creation using imap.addBox.
    createFolder(folderName: string): Promise<void> {
        return new Promise((resolve, reject) => {
            this.imap.addBox(folderName, (err: Error | null) => {
                if (err) return reject(err);
                resolve();
            });
        });
    }
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 of behavioral disclosure. It states the tool creates a folder but doesn't cover critical aspects like required permissions, whether the operation is idempotent, error handling for duplicate names, or what happens on success/failure. This leaves significant gaps for a mutation tool.

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, direct sentence with no wasted words. It's front-loaded with the core action and resource, making it highly efficient and easy to parse for an AI agent.

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 the tool's complexity as a mutation operation with no annotations and no output schema, the description is incomplete. It lacks details on behavioral traits, error conditions, return values, and usage context, which are essential for safe and effective tool invocation by an AI agent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 1 parameter with 0% description coverage, so the description must compensate. It doesn't explicitly mention the 'folderName' parameter or provide additional details like naming conventions or restrictions. However, with only one parameter, the tool's purpose inherently implies its use, justifying a baseline score above minimum.

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 ('Creates') and the resource ('a new folder in the IMAP account'), providing a specific verb+resource combination. However, it doesn't differentiate from sibling tools like 'deleteFolder' or 'getFolderList' beyond the obvious action difference, which prevents 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. It doesn't mention prerequisites (e.g., needing an active IMAP connection), exclusions, or comparisons to sibling tools like 'getFolderList' for listing folders. This lack of contextual direction limits its usefulness for an AI agent.

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