Literary agents have two main functions. They separate the best writing from the rest, so that editors can spend more time editing and producing the best books they can; and they get their clients the best deal possible—which doesn’t always mean going for the biggest advance.
Is it also part of an agent’s job to provide writers with editorial advice? I would say yes. In order to get the best deal for their clients they have to know that the book is as good as it can be before it goes out, and doing this requires some degree of editing. It might not be substantial (although sometimes it is): it could consist of a couple of general comments or it could be a far more rigorous and penetrating process.
Some agents say that they don’t edit their clients’ work and while this might well be true, it doesn’t mean that they offer no editorial advice at all. They do it every time they reject a submission and comment “I didn’t love this enough”, or “this is not right for me”. Such comments constitute valuable editorial advice. Even more valuable is the blank rejection which implies that the writing is just not good enough, which every writer would be wise to pay close attention to no matter how hurtful they find it.