list_issues
Retrieve and filter issues from a Taiga project using session and project IDs to manage and resolve project tasks efficiently.
Instructions
Lists issues within a specific project, optionally filtered.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filters | Yes | ||
| project_id | Yes | ||
| session_id | Yes |
Implementation Reference
- src/server.py:604-623 (handler)The handler function implementing the 'list_issues' tool logic. It uses the session_id to get an authenticated Taiga client, lists issues for the specified project using pytaigaclient.api.issues.list(), applies optional filters, and handles errors appropriately.@mcp.tool("list_issues", description="Lists issues within a specific project, optionally filtered.") def list_issues(session_id: str, project_id: int, **filters) -> List[Dict[str, Any]]: """Lists issues for a project. Optional filters like 'milestone', 'status', 'priority', 'severity', 'type', 'assigned_to' can be passed as kwargs.""" logger.info( f"Executing list_issues for project {project_id}, session {session_id[:8]}, filters: {filters}") taiga_client_wrapper = _get_authenticated_client(session_id) # Use wrapper variable name try: # Use pytaigaclient syntax: client.resource.list(project_id=..., **filters) issues = taiga_client_wrapper.api.issues.list(project_id=project_id, **filters) # return [i.to_dict() for i in issues] # Remove .to_dict() return issues # Return directly except TaigaException as e: logger.error( f"Taiga API error listing issues for project {project_id}: {e}", exc_info=False) raise e except Exception as e: logger.error( f"Unexpected error listing issues for project {project_id}: {e}", exc_info=True) raise RuntimeError(f"Server error listing issues: {e}")
- src/server.py:39-52 (helper)Helper function used by 'list_issues' (and other tools) to retrieve and validate the TaigaClientWrapper instance from the active_sessions dictionary based on the session_id.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:604-604 (registration)The @mcp.tool decorator registers the 'list_issues' function as an MCP tool with the specified name and description. FastMCP infers the input schema from the function signature.@mcp.tool("list_issues", description="Lists issues within a specific project, optionally filtered.")