"""get_activity MCP tool implementation.""" from xer_mcp.db.queries import get_activity_by_id from xer_mcp.server import is_file_loaded async def get_activity(activity_id: str) -> dict: """Get detailed information for a specific activity by ID. Args: activity_id: The task_id of the activity Returns: Dictionary with complete activity details or error """ if not is_file_loaded(): return { "error": { "code": "NO_FILE_LOADED", "message": "No XER file is loaded. Use the load_xer tool first.", } } activity = get_activity_by_id(activity_id) if activity is None: return { "error": { "code": "ACTIVITY_NOT_FOUND", "message": f"Activity not found: {activity_id}", } } return activity