Skip to main content
Glama
stevereiner
by stevereiner

create_folder

Create a new folder in Alfresco content management system to organize documents and files within a specified parent directory.

Instructions

Create a new folder in Alfresco.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
folder_nameYes
parent_idNo-shared-
descriptionNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • Core handler function that implements the logic for creating a folder in Alfresco using the core client API.
    async def create_folder_impl(
        folder_name: str, 
        parent_id: str = "-shared-", 
        description: str = "",
        ctx: Optional[Context] = None
    ) -> str:
        """Create a new folder in Alfresco.
        
        Args:
            folder_name: Name of the new folder
            parent_id: Parent folder ID (default: shared folder)
            description: Folder description
            ctx: MCP context for progress reporting
        
        Returns:
            Folder creation confirmation with details
        """
        if ctx:
            await ctx.info(f">> Creating folder '{folder_name}' in {parent_id}")
            await ctx.info("Validating folder parameters...")
            await ctx.report_progress(0.0)
        
        if not folder_name.strip():
            return safe_format_output("❌ Error: folder_name is required")
        
        try:
            # Ensure connection and get client factory (working pattern from test)
            await ensure_connection()
            from ...utils.connection import get_client_factory
            
            # Get client factory and create core client (working pattern from test)
            client_factory = await get_client_factory()
            core_client = client_factory.create_core_client()
            
            if ctx:
                await ctx.info("Creating folder in Alfresco...")
                await ctx.report_progress(0.5)
            
            logger.info(f"Creating folder '{folder_name}' in parent {parent_id}")
            
            # Prepare properties
            properties = {"cm:title": folder_name}
            if description:
                properties["cm:description"] = description
            
            logger.info(f"Using high-level API: core_client.nodes.create_folder()")
            
            # Use the working high-level API pattern from test script
            folder_response = core_client.nodes.create_folder(
                name=folder_name,
                parent_id=parent_id,
                properties=properties
            )
            
            if folder_response and hasattr(folder_response, 'entry'):
                entry = folder_response.entry
                logger.info("βœ… Folder created successfully")
                
                # Extract folder details from response
                folder_id = getattr(entry, 'id', 'Unknown')
                folder_name_response = getattr(entry, 'name', folder_name)
                created_at = getattr(entry, 'createdAt', 'Unknown')
                node_type = getattr(entry, 'nodeType', 'cm:folder')
            else:
                raise Exception(f"Failed to create folder - invalid response from core client")
            
            if ctx:
                await ctx.info("Processing folder creation response...")
                await ctx.report_progress(0.9)
            
            if ctx:
                await ctx.info("Folder created!")
                await ctx.report_progress(1.0)
                await ctx.info(f"SUCCESS: Folder '{folder_name_response}' created successfully")
                
            # Clean JSON-friendly formatting (no markdown syntax)
            return safe_format_output(f"""βœ… Folder Created Successfully!
    
    πŸ“ Name: {folder_name_response}
    πŸ†” Folder ID: {folder_id}
    πŸ“ Parent: {parent_id}
    πŸ“… Created: {created_at}
    🏷️ Type: {node_type}
    πŸ“ Description: {description or 'None'}""")
            
        except Exception as e:
            error_msg = f"❌ Folder creation failed: {str(e)}"
            if ctx:
                await ctx.error(error_msg)
            logger.error(f"Folder creation failed: {e}")
            return safe_format_output(error_msg) 
  • Registration of the 'create_folder' tool using FastMCP @mcp.tool decorator, which also defines the input schema via type annotations.
    @mcp.tool
    async def create_folder(
        folder_name: str, 
        parent_id: str = "-shared-", 
        description: str = "",
        ctx: Context = None
    ) -> str:
        """Create a new folder in Alfresco."""
        return await create_folder_impl(folder_name, parent_id, description, ctx)
  • Import of the create_folder_impl handler function.
    from .tools.core.create_folder import create_folder_impl
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 any behavioral traits: no information about required permissions, whether the operation is idempotent, what happens on conflicts, rate limits, or what the output contains. The description is minimal and lacks crucial context for a mutation operation.

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 extremely conciseβ€”a single sentence with no wasted words. It's front-loaded with the core action and resource, making it easy to parse quickly. Every word earns its place by conveying essential purpose.

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 tool has an output schema (which handles return values) and no annotations, the description is minimally complete for stating what it does. However, for a mutation tool with 3 parameters and no annotation coverage, it should provide more context about behavior, usage, and parameters to be fully helpful to an agent.

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?

The description adds no parameter semantics beyond what the input schema provides. With 0% schema description coverage, the schema titles ('Folder Name', 'Parent Id', 'Description') give basic hints, but the description doesn't explain what these parameters mean (e.g., what 'parent_id' format is, what '-shared-' default implies). Baseline is 3 since schema coverage is low but description doesn't compensate.

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 ('a new folder in Alfresco'), making the purpose immediately understandable. It distinguishes this as a creation tool among siblings that include deletion, download, search, and update operations, though it doesn't explicitly differentiate from similar creation tools like 'upload_document'.

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 parent folder permissions), when not to use it (e.g., for creating documents instead of folders), or direct alternatives among the sibling tools like 'upload_document' for files.

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/stevereiner/python-alfresco-mcp-server'

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