Skip to main content
Glama
stevereiner
by stevereiner

update_node_properties

Modify metadata and properties of documents or folders in Alfresco content management systems to maintain accurate information and organization.

Instructions

Update metadata and properties of a document or folder.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
node_idYes
nameNo
titleNo
descriptionNo
authorNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • Core handler implementation that validates input, cleans node ID, fetches current node info, prepares UpdateNodeRequest with properties, calls Alfresco core API to update, and returns formatted success message with changes.
    async def update_node_properties_impl(
        node_id: str,
        name: str = "",
        title: str = "",
        description: str = "",
        author: str = "",
        ctx: Optional[Context] = None
    ) -> str:
        """Update metadata and properties of a document or folder.
        
        Args:
            node_id: Node ID to update (required)
            name: New name for the node (optional)
            title: Document title (cm:title) (optional)
            description: Document description (cm:description) (optional)
            author: Document author (cm:author) (optional)
            ctx: MCP context for progress reporting
        
        Returns:
            Update confirmation with changes made
        """
        if ctx:
            await ctx.info(f"Updating properties for: {node_id}")
            await ctx.report_progress(0.1)
        
        if not node_id.strip():
            return "ERROR: node_id is required"
        
        if not any([name, title, description, author]):
            return "ERROR: At least one property (name, title, description, or author) must be provided"
        
        try:
            # Ensure connection and get core client
            await ensure_connection()
            core_client = await get_core_client()
            
            # Clean the node ID (remove any URL encoding or extra characters)
            clean_node_id = node_id.strip()
            if clean_node_id.startswith('alfresco://'):
                # Extract node ID from URI format
                clean_node_id = clean_node_id.split('/')[-1]
            
            logger.info(f"Updating properties for node: {clean_node_id}")
            
            if ctx:
                await ctx.report_progress(0.3)
            
            # Get node information first to validate it exists
            try:
                node_response = core_client.nodes.get(node_id=clean_node_id)
                if not hasattr(node_response, 'entry'):
                    return f"ERROR: Failed to get node information for: {clean_node_id}"
                
                node_info = node_response.entry
                current_name = getattr(node_info, 'name', f"document_{clean_node_id}")
                
            except Exception as get_error:
                return f"ERROR: Failed to validate node {clean_node_id}: {str(get_error)}"
            
            if ctx:
                await ctx.report_progress(0.5)
            
            # Prepare updates for actual API call
            properties_updates = {}
            if title and title.strip():
                properties_updates['cm:title'] = title.strip()
            if description and description.strip():
                properties_updates['cm:description'] = description.strip()
            if author and author.strip():
                properties_updates['cm:author'] = author.strip()
            
            # Import the UpdateNodeRequest model
            try:
                from python_alfresco_api.clients.core.nodes.models import UpdateNodeRequest
            except ImportError:
                return "ERROR: Failed to import UpdateNodeRequest model"
            
            # Prepare update request
            update_request = UpdateNodeRequest()
            
            if name and name.strip():
                update_request.name = name.strip()
            if properties_updates:
                update_request.properties = properties_updates
                
            if ctx:
                await ctx.report_progress(0.7)
            
            # Use the core client's update method
            try:
                updated_node = core_client.nodes.update(
                    node_id=clean_node_id,
                    request=update_request
                )
                logger.info("Node properties updated successfully")
                
            except Exception as update_error:
                logger.error(f"Update failed: {update_error}")
                return f"ERROR: Update failed: {str(update_error)}"
    
            if ctx:
                await ctx.report_progress(1.0)
            
            changes = []
            if name:
                changes.append(f"- Name: {name}")
            if title:
                changes.append(f"- Title: {title}")
            if description:
                changes.append(f"- Description: {description}")
            if author:
                changes.append(f"- Author: {author}")
            
            updated_properties = "\n".join(changes)
            
            # Clean JSON-friendly formatting (no markdown syntax)
            return f"Node Updated Successfully\n\nNode ID: {clean_node_id}\nUpdated Properties:\n{updated_properties}\nUpdate completed successfully"
            
        except Exception as e:
            error_msg = f"ERROR: Update failed: {str(e)}"
            if ctx:
                await ctx.error(error_msg)
            logger.error(f"Update failed: {e}")
            return error_msg 
  • Tool registration using @mcp.tool decorator in FastMCP server. Defines input parameters (schema) and delegates to the core impl function.
    @mcp.tool
    async def update_node_properties(
        node_id: str,
        name: str = "",
        title: str = "",
        description: str = "",
        author: str = "",
        ctx: Context = None
    ) -> str:
        """Update metadata and properties of a document or folder."""
        return await update_node_properties_impl(node_id, name, title, description, author, ctx)
  • Input schema defined by function parameters: node_id (required str), optional name/title/description/author (str), ctx (Context). Returns str confirmation.
    async def update_node_properties(
        node_id: str,
        name: str = "",
        title: str = "",
        description: str = "",
        author: str = "",
        ctx: Context = None
    ) -> str:
        """Update metadata and properties of a document or folder."""
        return await update_node_properties_impl(node_id, name, title, description, author, ctx)
Behavior2/5

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

With no annotations provided, the description carries full burden but only states it 'updates' without clarifying behavioral aspects like permissions needed, whether changes are reversible, rate limits, or what the output contains. It mentions 'metadata and properties' but doesn't detail scope or constraints.

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?

Single sentence is efficient and front-loaded with the core action. However, it could be more structured by explicitly listing updatable fields or adding brief context without becoming verbose.

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 complexity (mutation tool with 5 params, no annotations) and an output schema (which reduces need to describe returns), the description is minimally adequate but lacks details on error conditions, idempotency, or example use cases. It covers the basic purpose but leaves gaps for safe invocation.

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 0%, so the description must compensate but only vaguely references 'metadata and properties'. It doesn't explain parameter meanings (e.g., 'node_id' identifies the target, 'name' vs 'title' differences) or usage context. Baseline is 3 due to moderate parameter count (5) but lack of detailed compensation.

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 ('Update') and target ('metadata and properties of a document or folder'), which distinguishes it from siblings like 'delete_node' or 'get_node_properties'. However, it doesn't specify what types of metadata/properties are updatable beyond what's implied by the input schema.

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?

No explicit guidance on when to use this tool versus alternatives like 'checkin_document' or 'create_folder'. The description implies it's for modifying existing nodes, but doesn't mention prerequisites (e.g., node must exist), exclusions, or comparisons to sibling tools.

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