Solomon might as well have replied, “Lord, I am blind. I want to see,” like Bartimaeus, when God asked him one dark evening before his reign, “What do you want?” Because Solomon's answer was essentially the same. And in both cases God granted their wish. Which says something.
But the important point of the story, for Solomon as well as Bartimaeus--even though every Calvinist (who for some reason is determined everyone should be as sad and angry as John Calvin, believing with the Pharisees man was made for the Sabbath) would heartily disagree--is not whether God knew, or didn't know what Solomon wanted before He granted his wish, but rather, whether Solomon knew, or didn't know what Solomon wanted before He granted his wish. It has been long argued using the scriptures, by persons much smarter than I, how gravely important it should be to me that God knows what I want. But what it is not arguable in the scriptures is how important it is to God that I know what I want. God actually knows what I want: sure, I'm not debating that. I'm simply pointing out that even if it is awe-inspiring and comforting; it isn't very helpful. But what is helpful, because God knows it's helpful, is if I actually know what I want. God implies in His question and answer session with Solomon: not only is it wise to answer the question, "What do you want?" correctly, but also foolish to answer incorrectly. He leaves no room for the arbitrary answer. So if I answer, “I want a long life,” it reveals not how wise I almost am, but how foolish I certainly am. God seems to say it is not merely wishful thinking, or positive thinking, or maybe even a slight overreach in powerful thinking to desire all my enemies to be defeated, but profoundly foolish thinking—not because wishing for their defeat makes me wrong, but because it makes me weak; that it is not only wishful thinking or forward thinking to desire wealth, but foolish thinking—not because wishing for wealth makes me wrong, but because it makes me cheap. Therefore the wisest man in all the world answers not, “I want to see long life,” or “I want to see all my enemies defeated,” or, “I want to see wealth,” but instead, “Lord, I am blind. I just want to see,” in a sense, see everything. Because when a man finally sees everything, one of the first thing he sees is how little things are. Because he simply sees, for example, he sees how little a thing like a man’s net worth is. He sees low enough to see the infinite wealth adorning a lily of the field. And in the very next instant the foolish man who once saw his own life and the terrifying and inevitable death thereof, as a tragedy of incalculable loss, now sees with wisdom his life is no larger or more important than a lily plucked from the soil worth ten thousand of Solomon’s kingdoms and tossed away in the breeze.