update_project
Modifies existing project details on the Taiga project management platform using session and project IDs, enabling streamlined project updates through AI integration.
Instructions
Updates details of an existing project.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| kwargs | Yes | ||
| project_id | Yes | ||
| session_id | Yes |
Implementation Reference
- src/server.py:207-242 (handler)The handler function for the 'update_project' MCP tool. It authenticates the session, fetches the current project version, and calls the Taiga API to update the project with provided kwargs.@mcp.tool("update_project", description="Updates details of an existing project.") def update_project(session_id: str, project_id: int, **kwargs) -> Dict[str, Any]: """Updates a project. Pass fields to update as keyword arguments (e.g., name='New Name', description='New Desc').""" logger.info( f"Executing update_project ID {project_id} for session {session_id[:8]} with data: {kwargs}") taiga_client_wrapper = _get_authenticated_client(session_id) # Use wrapper variable name try: # Use pytaigaclient update pattern: client.resource.update(id=..., data=...) if not kwargs: logger.info(f"No fields provided for update on project {project_id}") # Return current state if no updates provided return taiga_client_wrapper.api.projects.get(project_id=project_id) # First fetch the project to get its current version current_project = taiga_client_wrapper.api.projects.get(project_id=project_id) version = current_project.get('version') if not version: raise ValueError(f"Could not determine version for project {project_id}") # The project update method requires project_id, version, and project_data updated_project = taiga_client_wrapper.api.projects.update( project_id=project_id, version=version, project_data=kwargs ) logger.info(f"Project {project_id} update request sent.") # Return the result from the update call return updated_project except TaigaException as e: logger.error( f"Taiga API error updating project {project_id}: {e}", exc_info=False) raise e except Exception as e: logger.error( f"Unexpected error updating project {project_id}: {e}", exc_info=True) raise RuntimeError(f"Server error updating project: {e}")