One of the first questions that an inventor asks is whether they have a patentable invention. Unfortunately, there is never a clear answer that a patent attorney can give an inventor as the outcome depends on a variety of factors that can't be predicted. 35 U.S.C. 101 states, "Whoever invents or discovers any new and useful process, machine, manufacture, or composition of matter, or any new and useful improvement thereof, may obtain a patent therefor, subject to the conditions and requirements of this title." In short, anything made by man is patentable as long as it is new and unobvious unless it is an abstract idea, a law of nature, or a natural phenomena.
Once a patent attorney understands the inventor's idea, they usually have a sense whether it is the type that could be patented. However, at this point it is unknown whether there exists a prior art reference that could be used to reject your application on either an anticipation basis or an obvious basis. Anticipation and obviousness are the two main rejections an Examiner at the United States Patent and Trademark Office (USPTO) will use to reject your application. This is why it is critical you have a patent attorney who can argue on your behalf and overcome these rejections.
When a utility application is filed an Examiner will first perform a search to determine the prior art. The Examiner will perform this search after an application has been filed, meaning you have already paid the cost of filing an application which is easily $6,000 or more. Also, it is typical the Examiner has gotten to your application after a year or more, meaning you have been waiting that long just to hear back from the USPTO. For these reasons, if there is any doubt I recommend an inventor perform a search before preparing an application.
There are a multitude of search firms based near the USPTO that will conduct a preliminary patentability search on your behalf. Typically a search costs about $1,500. The search can then be used to help determine whether the risk of moving forward is justified. For instance, the preliminary patentability search might reveal a piece of prior art that fully describes and details your invention. In that case, the cost of preparing an application has been saved and the search has been worth the cost. In another case, the preliminary patentability search might reveal a prior art document that shows some aspects of your invention, but not others. Then the application can be tailored initially to overcome these obstacles ultimately resulting in a stronger patent. In yet another case, the search might reveal no relevant prior art and the chance of obtaining a broad patent are very high.
It is up to the inventor/client whether they want to incur the additional cost of performing a preliminary patentability search. The preliminary patentability search doesn't guarantee an outcome, but it reduces the risk of getting a rejection that can't be overcome. In practice, preliminary search results add value to the overall patent as the patent attorney has a basis to work from and can tailor the application to overcome potential problems.