How perfect does your manuscript need to be for an editor to consider it seriously? (Assuming that the story is good.)
For example, does every bit of punctuation need to be perfect? I'm as careful as I know how to be, but I tend to abuse commas. For example, in the previous sentence, should there be a comma where I placed it? (Between be and but?) If it doesn't belong there and I submitted a manuscript containing such an error, would an editor think I'm a dolt and just toss the manuscript aside?
How perfect do writers need to be?
Make it the BEST you can, then submit and forget about it.
There's no such thing as ABSOLUTE perfection. Trying to reach for that is a recipe for misery and insanity.
If you have a great story, great characters, and a great style, I'm sure the agent will look past the occasional grammatical and spelling errors.
If your writing sucks, it doesn't matter how great your grammar is.
But it doesn't mean you shouldn't pay attention to the mechanics. But don't let them distract from your story and characters.
Do the BEST you can.