Imagine that one night you have a dream in which you are in an enormous bookstore lined with shelves upon shelves of books, each bound in the same plain white cover displaying only the author’s name, the title of the book, and a brief description of the book and its author. This is an anxiety dream, so it turns out that your livelihood depends on your ability to search this enormous bookstore and figure out which books are good and which aren’t. The thing is, in this bookstore, the vast majority of the books are bad – trite, derivative, poorly written, or simply the sort of book you would never read in a million years. You know there are some really good books in this store, maybe even one or two genuinely great ones, but from the outside they’re indistinguishable from the terrible ones.

How do you choose? Do you sit down at the first shelf and read each book all the way through? No way; you’d starve, if you didn’t kill yourself from boredom first. Do you glance at the descriptions of the book and author on the back cover, and then read a page or two of the ones that sound more interesting? That’s better, but we’re talking a huge room here – thousands and thousands of books – and what can you really tell from a couple of paragraphs, anyway?

So you begin to look for shortcuts. You decide to only consider the kinds of books you already know you like – mysteries, say, and literary novels with strong female protagonists. Still, there are a lot of mysteries and novels with strong female protagonists in this bookstore. So you look for other shortcuts. If you recognize the name of the author as someone who has already written something else good, you read that one. You might also look for other people in the bookstore so you could ask them what good books they had read lately and start looking for those. You might even take some of them out for lunch – it’s okay, you can expense it – to pick their brains.

For several hundred people, most of them living in New York City, this dream is their daily reality. They are called literary agents, and if you are a writer with one or more unpublished books on your hard drive you have probably received a terse note from several dozen of them telling you that your novel is “not a right fit” for their agency at this time. In that moment you tore open that thin self-addressed envelope or read the two-line return email, you probably hated them. Not just that one agent, but all literary agents, as a class. How could they not see the brilliance in your manuscript? How could they possibly guess at the quality of your manuscript based on a one-page letter and a synopsis? And what the hell does “not a right fit” mean, anyway? Is that even grammatical English?

This is a perfectly natural and human response. It hurts to be rejected, and it hurts even more when you walk into a real bookstore, one with chirpy sales clerks and splashy book covers, and see truly godawful books by authors represented by some of these very same agents. But as natural as that rage might be, as satisfying as it is to rant to your friends or online about the idiocy of the people in mainstream publishing, this anger is misplaced. There are good literary agents and bad ones – the gap between the two is huge – but literary agents are only middlemen navigating the rough seas between the swarms of unpublished writers and an ever-diminishing readership for literary fiction.

If your book isn’t selling, literary agents are not to blame. It may be that your book doesn’t really belong in mainstream commercial publishing, in which case you should consider self-publication or send your book to an indie publisher like Ig, Two Dollar Radio or Small Beer Press. Or it may be that your book would appeal to a mainstream publisher, but you haven’t done the groundwork you need to do to get out of the slush pile and onto a literary agent’s radar. Or perhaps your book just isn’t ready yet. Whatever the case, you would be wise to pay attention to what literary agents are trying to tell you, even if all they’re saying is “no”.

I should know because I recently finished a novel and have spent the last six months hearing polite, carefully hedged versions of “no.” This can be an enormously confusing, even maddening process. One agent will say she found my book too commercial, and then a few weeks later another will say she thought the plot “too quiet” and wished it had been more overtly commercial. Well, which is it? Commercial-minded pap, or wannabe Henry James?

One of the nice things about being a journalist is that when you want to know how something works, you can call up people who know and they will sit down and explain it for you. So earlier this year, on assignment from Poets & Writers magazine, I spent a day at the offices of Folio Literary Management in Midtown Manhattan to see for myself what literary agents do all day.

In the piece, which appears in the July/August issue of Poets & Writers, Folio co-founder Scott Hoffman explains that the agency receives roughly 100,000 unsolicited queries a year, or about 200 a week for each of the nine Folio agents who accept unsolicited queries. Hoffman has taken on four new writers in the last year, only one of whom came in through the slush pile, putting the odds of an author without connections getting Hoffman to take on his or her book at roughly 1 in 11,111. When I sat down with another agent, Michelle Brower, as she read her slush pile, I watched her power through 19 query letters in 14 minutes, rejecting 18 of them and putting one aside for more consideration.

Now, it may sound heartless to reject 18 query letters in 14 minutes, and every time Brower hit send on a rejection email, my heart sagged a little at the poor writer seeing yet another rejection from an agent, but you have to see it from the agent’s perspective. Literary agents work on commission – typically, an agent takes 15% of a client’s earnings – and every minute an agent spends working on a manuscript that doesn’t sell is a minute that agent is working for free.

This, I think, helps explain the anger and angst so many writers feel toward agents and other publishing professionals. Most writers when they show their work to someone – a professor, a friend, a spouse – they have a reasonable expectation of getting encouragement or at least some useful feedback. But an agent isn’t a friend. An agent isn’t a teacher, either. An agent’s job is to find an author whose novel is ready for publication, or so close to ready that it makes economic sense for the agent to put the time into helping make it ready, and connect that writer to a publisher. That’s it. The better agents attend writing conferences, visit MFA programs, and scour literary magazines for fresh talent, but all the rest of it, getting your work to a publishable level, building a track record that will be attractive to a publishing house, wangling connections that will get you out of the slush pile – that’s your job.

If you are sending out query letters blindly to dozens of literary agents, as I did when I finished my first book five years ago, you’re engaging in the same kind of magical thinking that makes people buy lottery tickets. You might get lucky, but the odds of that are, well, somewhere in the neighborhood of 1 in 11,111. If you want to improve your odds, you have to do serious research. You have to find agents who represent books similar to yours, and then craft your query letter to them to let them know why they should be taking you on. Many writers now have websites that name their agents, and most literary agencies have sites online that say what kinds of books they are looking for and which authors they represent. There are also databases, such as the one run by Poets & Writers, that list reputable agents and offer links to their websites.

But, really, that’s only a small part of what you need to do. Like most human enterprises, publishing is a relationship business. Literary agents – the good ones, anyway – are smart, quick readers, but these are books we’re talking about. It can take three or four days to read a book, and agents spend their working hours negotiating contracts and networking with other publishing people, leaving their reading to nights and weekends. They simply don’t have time to read all the books they’d like to read, even the ones from writers who sound like they might be talented. So, agents work with people they know, and friends of people they know.

If that sounds like I’m saying, “It’s all about who you know,” that’s because that is exactly what I’m saying. You can rail about how unfair that is, and how it makes publishing into an incestuous little club, and to a degree you would be right: a lot of very dumb books get published because somebody knew somebody. But that’s the way the machine is built, people. It may come a-tumbling down in the near future in the face of e-books and indie publishers, but for now, if you want to get published by a major publisher, you have two choices: you can keep banging your head against a wall and be angry, or you can figure out how to get yourself into the club.

To do that, you have to immerse yourself in the literary community. Five years ago, with my first book, I sent roughly 60 query letters to agents and editors at smaller publishing houses. I had an MFA, a few publications in small literary magazines, and not much else. My success rate – that is, the percentage who asked to see all or part of the manuscript – scraped along at about 10%. It was, let me tell you, dispiriting as hell. Then I went to a couple writing conferences, and my success rate began to climb. I met agents in person and told them about my book. I met other writers who referred me to their agents. By the end, my book was getting read by about half of the people I sent it to, a fair number of whom seriously considered taking it on.

That experience, painful as it was, taught me more about writing than I ever would have expected. Agents and editors began writing me real letters, not form rejections, but long, thoughtful responses telling me precisely where they had stopped reading with interest and why. Until then, I had always written for other writers – classmates, friends, the dead greats I imagined myself competing with – but that experience taught me to write for a reader, a smart, curious person who just wants to be told a good story.

By the time I finished my most recent novel, I had published a few more stories, plus I was now writing for Poets & Writers, as well as The Millions and other book reviews. More importantly, I had built up an inventory of agents interested in seeing my next book and writer friends who felt comfortable referring me to their agents. By my count, I’ve sent queries to 11 agents and editors, nine of whom asked to see the full manuscript. Their responses have varied from a few lines of boilerplate regret to two hours on the phone discussing my characters and story in brutally honest detail. Ultimately, of course, no is no, and I still don’t have an agent. But that’s my fault: I haven’t written a book an agent can sell yet.

At this point, I am seriously thinking about revising the book from beginning to end before I send it out again. If that sounds like a sad ending to this tale, then I haven’t made my point. I did the groundwork and got the attention of first-class literary agents who have helped launch bestselling authors and Pulitzer Prize winners. They took me seriously, and I learned two things from their responses: first, that the book I’ve written is definitely in the ballpark, and second, that it isn’t there yet. I can cry and tear my hair out, but this is the real world. If I want my book published, and I do, I have to make it better.

Mainstream publishing is a Rube Goldberg machine of perverse economic incentives, in which large numbers of mostly idiotic self-help guides, diet books, and airport thrillers subsidize an ever-shrinking number of mostly money-losing literary novels and books of poetry. But just because publishing operates on a crazy economic model doesn’t mean it doesn’t make sense. There is a market, however tiny, for good books, and there are a small number of smart, hard-working people who live for the thrill of finding a talented author. If you are one of those talented authors, then it is your job to stop whining and figure out how to make it easy for them to find you.

Image via CompletelyNovel.com/Flickr