Skip to main content
Glama

rename_folder

Change the name of an email folder in your Mail MCP Server to better organize your messages. Specify the current folder name and the new desired name.

Instructions

Rename an email folder

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
old_nameYesCurrent folder name
new_nameYesNew folder name

Implementation Reference

  • The FolderManager.rename_folder method executes the IMAP RENAME command after validating folder names and checking for existence.
    def rename_folder(self, old_name: str, new_name: str) -> bool:
        """
        Rename a folder.
    
        Args:
            old_name: Current folder name
            new_name: New folder name
    
        Returns:
            True if successful
    
        Raises:
            InvalidFolderNameError: If either name is invalid
            FolderNotFoundError: If source folder does not exist
            FolderExistsError: If destination folder already exists
            FolderError: If operation fails
        """
        self._validate_folder_name(old_name)
        self._validate_folder_name(new_name)
    
        if old_name == new_name:
            raise InvalidFolderNameError("Source and destination names must be different")
    
        try:
            response = self._conn.rename(old_name, new_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 "does not exist" in error_msg.lower() or "not found" in error_msg.lower():
                    raise FolderNotFoundError(f"Folder '{old_name}' does not exist")
    
                if "already exists" in error_msg.lower():
                    raise FolderExistsError(f"Folder '{new_name}' already exists")
    
                raise FolderError(f"Failed to rename folder: {error_msg}")
    
            return True
    
        except FolderError:
            raise
        except Exception as e:
            raise FolderError(f"Failed to rename folder: {str(e)}")
Behavior2/5

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

No annotations are provided, so the description carries full burden of behavioral disclosure. It fails to specify mutation semantics (idempotency, atomicity), error handling (what if 'old_name' doesn't exist or 'new_name' is taken), or required permissions. For a state-changing operation, 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.

Conciseness4/5

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

Extremely concise at four words with no redundancy. The single sentence is front-loaded with the action. However, 'appropriately sized' is debatable given the lack of behavioral context that must be inferred by the agent.

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?

Given the simple input schema (two flat string parameters) and lack of output schema, the description covers the happy path adequately. However, for a mutation tool with zero annotations, it lacks necessary context regarding failure modes, transaction safety, and side effects.

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?

Schema description coverage is 100% ('Current folder name' and 'New folder name'), so the baseline expectation is met. The description adds no additional parameter context (e.g., case sensitivity, character limits), but none is required given the comprehensive schema.

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?

States a specific verb ('Rename') and resource ('email folder'), clearly distinguishing from sibling tools like 'create_folder', 'delete_folder', and 'move_email'. However, it lacks scope constraints (e.g., whether it works on system folders or only user-created ones).

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?

Provides no guidance on when to use this tool versus alternatives, nor any prerequisites (e.g., folder existence checks) or exclusion criteria. The agent receives no signals about error conditions like name collisions.

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