Skip to main content
Glama

update_node_properties

Modify metadata and properties of documents or folders by specifying node ID, name, title, author, or description within Alfresco MCP Server for improved content management.

Instructions

Update metadata and properties of a document or folder.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
authorNo
descriptionNo
nameNo
node_idYes
titleNo

Implementation Reference

  • Core execution logic: validates inputs, ensures Alfresco connection, fetches node info, prepares UpdateNodeRequest with properties (name, cm:title, cm:description, cm:author), calls core_client.nodes.update(), formats 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
  • FastMCP tool registration via @mcp.tool decorator. Defines the tool schema (input parameters and docstring) and delegates execution to the impl function.
    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 signature: required node_id, optional name/title/description/author, Context. Returns str result.
    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)
  • Re-exports the update_node_properties module for convenient imports.
    update_node_properties, upload_document, ) __all__ = [ "browse_repository", "cancel_checkout", "checkin_document", "checkout_document", "create_folder", "delete_node", "download_document", "get_node_properties", "update_node_properties",

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

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