list_milestones
Retrieve milestones (sprints) from a Taiga project by providing session and project IDs. Simplify sprint management and planning through structured milestone data.
Instructions
Lists milestones (sprints) within a specific project.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_id | Yes | ||
| session_id | Yes |
Implementation Reference
- src/server.py:1006-1025 (handler)The core handler function implementing the 'list_milestones' MCP tool. It authenticates the session, calls the Taiga API to list milestones for the specified project, and returns the list of milestones.@mcp.tool("list_milestones", description="Lists milestones (sprints) within a specific project.") def list_milestones(session_id: str, project_id: int) -> List[Dict[str, Any]]: """Lists milestones for a project.""" logger.info( f"Executing list_milestones for project {project_id}, session {session_id[:8]}...") taiga_client_wrapper = _get_authenticated_client(session_id) # Use wrapper variable name try: # Use pytaigaclient syntax: client.resource.list(project_id=...) milestones = taiga_client_wrapper.api.milestones.list(project_id=project_id) # return [m.to_dict() for m in milestones] # Remove .to_dict() return milestones # Return directly except TaigaException as e: logger.error( f"Taiga API error listing milestones for project {project_id}: {e}", exc_info=False) raise e except Exception as e: logger.error( f"Unexpected error listing milestones for project {project_id}: {e}", exc_info=True) raise RuntimeError(f"Server error listing milestones: {e}")
- src/server.py:1006-1006 (registration)The @mcp.tool decorator registers the 'list_milestones' function as an MCP tool with the given name and description.@mcp.tool("list_milestones", description="Lists milestones (sprints) within a specific project.")
- src/server.py:39-52 (helper)Helper function used by 'list_milestones' to retrieve and validate the authenticated Taiga client for the session.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