Skip to main content
Glama

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
NameRequiredDescriptionDefault
project_idYes
session_idYes

Implementation Reference

  • 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}")
  • 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.")
  • 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

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/talhaorak/pytaiga-mcp'

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