Skip to main content
Glama
josedu90

MCP Google Workspace Server

drive_create_folder

Create a new folder in Google Drive by specifying its name and parent folder ID using the MCP Google Workspace Server.

Instructions

Create a new folder in Google Drive

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesName of the folder
parent_idNoID of parent folder

Implementation Reference

  • MCP tool handler that validates arguments and delegates folder creation to DriveService.
    async def _handle_drive_create_folder(
        self, context: GoogleWorkspaceContext, arguments: dict
    ) -> Dict[str, Any]:
        """Handle drive create folder requests."""
        name = arguments.get("name")
        parent_id = arguments.get("parent_id")
    
        if not name:
            raise ValueError("Folder name is required")
    
        logger.debug(f"Creating folder - Name: {name}, Parent: {parent_id or 'root'}")
        result = await context.drive.create_folder(name=name, parent_id=parent_id)
        logger.debug(f"Folder created - ID: {result.get('id')}")
        return result
  • Input schema definition for the drive_create_folder tool, specifying parameters name (required) and parent_id (optional).
    types.Tool(
        name="drive_create_folder",
        description="Create a new folder in Google Drive",
        inputSchema={
            "type": "object",
            "properties": {
                "name": {"type": "string", "description": "Name of the folder"},
                "parent_id": {"type": "string", "description": "ID of parent folder"},
            },
            "required": ["name"],
        },
    ),
  • Dynamic registration of the tool handler into the registry using naming convention '_handle_drive_create_folder'.
    handler_name = f"_handle_{tool.name}"
    if hasattr(self, handler_name):
        handler = getattr(self, handler_name)
        self._tool_registry[tool.name] = handler
        logger.debug(f"Registered handler for {tool.name}")
  • Core implementation in DriveService that creates the folder using Google Drive API v3.
    def create_folder(self, name: str, parent_id: Optional[str] = None) -> Dict[str, Any]:
        """Create a new folder in Google Drive."""
        try:
            file_metadata = {"name": name, "mimeType": "application/vnd.google-apps.folder"}
    
            if parent_id:
                file_metadata["parents"] = [parent_id]
    
            folder = (
                self.service.files()
                .create(body=file_metadata, fields="id, name, webViewLink")
                .execute()
            )
    
            return {"success": True, "folder": folder}
        except HttpError as error:
            return {"success": False, **self.handle_error(error)}
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 tool creates a folder but doesn't mention whether this requires specific permissions, what happens on duplicate names, if the operation is idempotent, or what the response contains (e.g., folder ID). For a mutation tool with zero annotation coverage, this leaves significant gaps in understanding the tool's behavior.

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, clear sentence with zero wasted words. It's front-loaded with the core action and resource, making it immediately understandable. Every word earns its place by specifying 'new folder' and 'Google Drive' context.

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 mutation tool with no annotations and no output schema, the description is incomplete. It doesn't explain what the tool returns (e.g., folder metadata or ID), error conditions, or behavioral nuances like permissions required. For a tool that modifies state, this lack of context leaves the agent under-informed about how to use it effectively.

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%, so both parameters ('name' and 'parent_id') are fully documented in the schema. The description adds no additional parameter semantics beyond implying a folder needs a name and parent location. This meets the baseline of 3 when the schema does the heavy lifting, but the description doesn't compensate with extra context like format examples or constraints.

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 ('Create') and resource ('new folder in Google Drive'), making the purpose immediately understandable. It doesn't explicitly differentiate from sibling tools like 'docs_create' or 'sheets_create', but the 'Google Drive' context provides some implicit distinction. The description avoids tautology by specifying what is being created rather than just restating the tool name.

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 like 'drive_search_files' for finding existing folders or 'docs_create' for creating documents. There's no mention of prerequisites (e.g., needing parent folder permissions) or exclusions (e.g., not for creating files). The agent must infer usage context solely from the tool name and description.

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

Related 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/josedu90/mcp-suiteg'

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