
126 P.3d 313 (2005)
Lillian BARTON, Plaintiff-Appellant,
v.
LAW OFFICES OF JOHN W. McKENDREE and John W. McKendree, Defendants-Appellees.
No. 04CA1155.
Colorado Court of Appeals, Div. II.
November 3, 2005.
*314 Lillian Barton, Pro Se.
Montgomery Little & McGrew, P.C., Christopher B. Little, Greenwood Village, Colorado, for Defendants-Appellees.
DAILEY, J.
Plaintiff, Lillian Barton, appeals the order awarding attorney fees to defendants, the Law Offices of John W. McKendree and John W. McKendree. We vacate the award of attorney fees.
This appeal arises from the dismissal of plaintiff's complaint against defendants based on McKendree's representation of her with regard to a criminal matter. The underlying facts are set out in a companion case affirming the trial court's judgment dismissing the case. See Barton v. McKendree, 2005 WL 2878085 (Colo.App. No. 04CA0643, Nov. 3, 2005)(not published pursuant to C.A.R. 35(f)).
As pertinent here, following the dismissal of the underlying case on defendants' motion to dismiss under C.R.C.P. 12(b)(5), defendants moved for their attorney fees under § 13-17-201, C.R.S.2005. The court determined that an award of fees under § 13-17-201, was mandatory and awarded defendants the full amount they sought. Plaintiff then brought this appeal.
Section 13-17-201 provides in relevant part:
In all actions brought as a result of a death or an injury to person or property occasioned by the tort of any other person, where any such action is dismissed on motion of the defendant prior to trial under rule 12(b) of the Colorado rules of civil procedure, such defendant shall have judgment for his reasonable attorney fees in defending the action.
Pursuant to this section, an award of attorney fees is mandatory when a trial court dismisses an action under C.R.C.P. 12(b). See Houdek v. Mobil Oil Corp., 879 P.2d 417, 425 (Colo.App.1994). However, an award of attorney fees is not warranted under this section when C.R.C.P. 12(b) was not the basis for dismissal of one or more claims in the action. See Rector v. City & County of Denver, 122 P.3d 1010, 2005 WL 170733 (Colo. App. No. 03CA0857, Jan. 27, 2005)(§ 13-17-201 "requires courts to award a defendant reasonable attorney fees whenever an entire tort action, but not merely one or more tort claims, is dismissed under C.R.C.P. 12(b)"); see also First Interstate Bank v. Berenbaum, 872 P.2d 1297, 1301-02 (Colo.App. 1993)(trial court erred in awarding attorney fees under § 13-17-201 when the court dismissed one claim under C.R.C.P. 12(b)(5) and entered summary judgment as to another).
C.R.C.P. 12(b) authorizes dismissal based on "(1) Lack of jurisdiction over the subject matter; (2) lack of jurisdiction over the person; (3) insufficiency of process; (4) insufficiency of service of process; (5) failure to state a claim upon which relief can be granted; [and] (6) failure to join a party under Rule 19."
"The purpose of a [C.R.C.P. 12(b)(5)] motion to dismiss for failure to state a claim upon which relief can be granted is to test the formal sufficiency of the complaint." Merrick v. Burns, Wall, Smith & Mueller, P.C., 43 P.3d 712, 713 (Colo.App.2001).
In analyzing a C.R.C.P. 12(b)(5) motion to dismiss, a court considers only *315 those matters stated in the complaint, accepting them as true and viewing them in the light most favorable to the plaintiff. A court may not grant the motion to dismiss unless it appears beyond doubt that the plaintiff cannot prove facts in support of a claim that would entitle it to relief. Coors Brewing Co. v. Floyd, 978 P.2d 663, 665 (Colo.1999).
Here, defendant sought dismissal of plaintiff's action under C.R.C.P. 12(b)(5). However, plaintiff had one claim  legal malpractice  which was not dismissed under C.R.C.P. 12(b)(5). As reflected in the division's opinion in the companion case, the trial court dismissed that claim based on plaintiff's failure to file a certificate of review within sixty days after service of the complaint, as required by § 13-20-602, C.R.S.2005.
Section 13-20-602 provides a mechanism for expeditiously resolving claims of professional negligence filed against licensed professionals. Martinez v. Badis, 842 P.2d 245, 251 (Colo.1992). The statute requires the plaintiff to file a certificate of review, the purpose of which "is to demonstrate that the plaintiff has consulted with a person who has expertise in the area and that the expert consulted has concluded that the claim does not lack substantial justification." Baumgarten v. Coppage, 15 P.3d 304, 306 (Colo.App. 2000). Under § 13-20-602(4), C.R.S.2005, "[t]he failure to file a certificate of review in accordance with this section shall result in the dismissal of the complaint."
Section 13-20-602 sets forth a special statutory ground for dismissal, separate from that of C.R.C.P. 12(b)(5) or others in C.R.C.P. 12(b). Because plaintiff's legal malpractice claim was not dismissed based on C.R.C.P. 12(b), we conclude that the trial court erred in awarding fees under § 13-17-201.
The order awarding attorney fees is vacated.
ROTHENBERG and LOEB, JJ., concur.
