There are several. First of all, the suit must state a claim for action under the law. This means there must be some law, or case law, which permits a person to sue in the kind of situation at hand. The claim for "looking at me funny" would probably be thrown out at this stage, unless perhaps it could be framed as a case of harassment. This often has a good deal to do with how the case is framed and what laws it cites as giving the plaintiff the right to sue, and the right to a remedy.
Secondly, the plaintiff must usually allege significant harm, actual or in some cases potential.
In federal courts, and some state courts this is often part of having standing to sue. A person only has standing when that person can show a real and significant actual harm, or a likely imminent harm, as a result of defendant's alleged actions. For example if a person claims that Congress has passed an unconstitutional law, but that person is not personally affected by the law, that person has no standing to sue.
Thirdly the claim must be one that is within the jurisdiction of the court. That means both that it is the kind of claim that the court is authorized to handle, aka subject matter jurisdiction, and that the court has authority over all parties (personal jurisdiction),
You can't sue for slander in a landlord/tenant or a traffic court court, the court lacks subject matter jurisdiction. Nor can you sue for theft under a state law in a federal court, it only has jurisdiction over "federal questions" (or in some cases over issues between people in different states, diversity jurisdiction). And if person A in Georgia did something to person B in Georgia, B cannot normally sue in a California court, although if the is some connection to California, the court may find it enough.
Thirdly the suit must present a claim for a remedy which the court is authorized by statute or precedent to give. In some kinds of cases, the law may permit an injunction. but not a claim for money damages. In proceedings for action under the California Consumer Privacy Act (for example) most provisions can only be enforced by the California Attorney General, not by a private litigant. This will vary widely depending on the specific law involved.
A classic example of a frivolous suit is United States ex rel. Gerald Mayo v. Satan and His Staff, 54 F.R.D. 282 (W.D.Pa. 1971) in which a prison inmate sued Satan and his assistant devils, claiming that "Satan has on numerous occasions caused plaintiff misery and unwarranted threats, against the will of plaintiff, that Satan has placed deliberate obstacles in his path and has caused plaintiff's downfall" and had therefore "deprived him of his constitutional rights". The judge noted that Satan was not under the control of the prison, and it was not clear if he was a US resident, but dismissed the suit on the technicality that the prisoner has not told the US Marshals where and how to serve the needed papers on Satan.
Dismissal of a lawsuit as frivolous, or as "not reasonable" is a judgement call by the court, guided by past cases on the topic, of which there are many. Details will matter. A good lawyer should be able to advise if such a dismissal is likely.