Skip to main content
Glama
adexltd

MCP Google Suite

by adexltd

drive_create_folder

Create a new folder in Google Drive to organize files and documents. Specify the folder name and optional parent folder ID.

Instructions

Create a new folder in Google Drive

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesName of the folder
parent_idNoID of parent folder

Implementation Reference

  • Handler function for drive_create_folder tool that validates input, calls DriveService.create_folder, and returns the result.
    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
  • Schema definition for the drive_create_folder tool, specifying input parameters and requirements.
    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"],
        },
    ),
  • DriveService method that performs the actual Google Drive API call to create a folder.
    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)}
  • Registers the handler for drive_create_folder (and other tools) in the tool registry used by call_tool.
    # Register tool handlers
    for tool in self._get_tools_list():
        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}")

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

C2.9/5.0
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.