Skip to main content
Glama

create_folder

Create a new email folder to organize messages by specifying a folder name. This tool helps users manage email structure within their email accounts.

Instructions

Create a new email folder

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
folder_nameYesName of the folder to create

Implementation Reference

  • The handler implementation for creating a folder using IMAP connection.
    def create_folder(self, name: str) -> bool:
        """
        Create a new folder/mailbox.
    
        Args:
            name: Name of the folder to create
    
        Returns:
            True if successful
    
        Raises:
            InvalidFolderNameError: If folder name is invalid
            FolderExistsError: If folder already exists
            FolderError: If operation fails
        """
        self._validate_folder_name(name)
    
        try:
            response = self._conn.create(name)
    
            status = response[0]
            if status not in ("OK", b"OK"):
                error_msg = (
                    response[1][0].decode("utf-8", errors="replace")
                    if response[1]
                    else "Unknown error"
                )
    
                if "already exists" in error_msg.lower():
                    raise FolderExistsError(f"Folder '{name}' already exists")
    
                raise FolderError(f"Failed to create folder: {error_msg}")
    
            return True
  • Tool registration/invocation for 'create_folder'.
    elif name == "create_folder":
        result = client.create_folder(arguments["folder_name"])
        return [TextContent(type="text", text=str(result))]
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. However, it fails to mention critical behavioral traits such as whether the operation is idempotent, what happens if a folder with the same name exists, or any permission requirements.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise at only four words with no filler content. However, given the lack of annotations and output schema, it may be inappropriately brief rather than optimally concise, though it efficiently communicates the core action.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a single-parameter tool with complete schema coverage, the description is minimally adequate. However, gaps remain regarding error handling (duplicate names), return values, and folder hierarchy behavior (nesting), which should be addressed given the absence of annotations or output schema.

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?

With 100% schema description coverage, the input schema fully documents the folder_name parameter. The description adds no additional parameter semantics (e.g., naming constraints, character limits), warranting the baseline score for high-coverage schemas.

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 uses a specific verb ('Create') and resource ('email folder'), making the purpose clear. It implicitly distinguishes from siblings like delete_folder and rename_folder through the verb choice, though it does not explicitly reference sibling tools.

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 (e.g., when to use rename_folder instead, or prerequisites like checking if a folder already exists). It simply states the action without contextual usage constraints.

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/AdJIa/mail-mcp-server'

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