update_milestone
Modify details of an existing milestone in Taiga project management via the Taiga MCP Bridge, enabling AI systems to update project progress efficiently.
Instructions
Updates details of an existing milestone.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| kwargs | Yes | ||
| milestone_id | Yes | ||
| session_id | Yes |
Implementation Reference
- src/server.py:1079-1112 (handler)The handler function decorated with @mcp.tool('update_milestone') that implements the core logic: authenticates the session, fetches the current milestone to get its version, and performs a partial update via the Taiga API's milestones.edit method.@mcp.tool("update_milestone", description="Updates details of an existing milestone.") def update_milestone(session_id: str, milestone_id: int, **kwargs) -> Dict[str, Any]: """Updates a milestone. Pass fields to update as kwargs (e.g., name, estimated_start, estimated_finish).""" logger.info( f"Executing update_milestone ID {milestone_id} for session {session_id[:8]} with data: {kwargs}") taiga_client_wrapper = _get_authenticated_client(session_id) # Use wrapper variable name try: # Use pytaigaclient edit pattern for partial updates if not kwargs: logger.info(f"No fields provided for update on milestone {milestone_id}") return taiga_client_wrapper.api.milestones.get(milestone_id) # Get current milestone data to retrieve version current_milestone = taiga_client_wrapper.api.milestones.get(milestone_id) version = current_milestone.get('version') if not version: raise ValueError(f"Could not determine version for milestone {milestone_id}") # Use edit method for partial updates with keyword arguments updated_milestone = taiga_client_wrapper.api.milestones.edit( milestone_id=milestone_id, version=version, **kwargs ) logger.info(f"Milestone {milestone_id} update request sent.") return updated_milestone except TaigaException as e: logger.error( f"Taiga API error updating milestone {milestone_id}: {e}", exc_info=False) raise e except Exception as e: logger.error( f"Unexpected error updating milestone {milestone_id}: {e}", exc_info=True) raise RuntimeError(f"Server error updating milestone: {e}")
- src/server.py:39-52 (helper)Shared helper function used by update_milestone (and other tools) to retrieve and validate the authenticated TaigaClientWrapper instance from the session store.def _get_authenticated_client(session_id: str) -> TaigaClientWrapper: """ Retrieves the authenticated TaigaClientWrapper for a given session ID. Raises PermissionError if the session is invalid or not found. """ client = active_sessions.get(session_id) # Also check if the client object itself exists and is authenticated if not client or not client.is_authenticated: logger.warning(f"Invalid or expired session ID provided: {session_id}") # Raise PermissionError - FastMCP will map this to an appropriate error response raise PermissionError( f"Invalid or expired session ID: '{session_id}'. Please login again.") logger.debug(f"Retrieved valid client for session ID: {session_id}") return client
- src/server.py:1079-1079 (registration)The @mcp.tool decorator registers the update_milestone function as an MCP tool with the specified name and description.@mcp.tool("update_milestone", description="Updates details of an existing milestone.")