Opinion by
Third-party defendant, Hutchens Trucking Company, Inc., appeals from an order denying its request for attorney fees and costs against third-party plaintiff, Crane Service, LLC. We affirm.
I.
Carlos Sotelo was killed when his coworker tried to operate a crane that had been left at a job site. The crane was owned by Crane Service and had been delivered to the site by Hutchens.
Luis Sotelo, Carlog's surviving parent, brought a wrongful death action against several parties, including Hutchens and Crane Service. The trial court eventually dismissed Sotelo's claims against Hutchens, but Crane Service remained in the case as a defendant.
Crane Service then asserted third-party claims against Hutchens for negligence, contribution, and breach of contract. Hutchens responded with a motion to dismiss under C.R.C.P. 12(b)(5). The trial court granted Hutchens's motion in part: it dismissed Crane Service's tort claims but declined to dismiss the claim for breach of contract.
Hutchens then sought an award of attorney fees under § 18-17-201, C.R.S.2006, and an award of costs under § 18-16-107, C.R.S. 2006. The court denied this request in a written order.
Later, Crane Service and Hutchens filed a stipulated motion to dismiss Crane Service's claim for breach of contract. The trial court granted this motion in a written order. A division of this court subsequently determined that this order was a final judgment.
IL.
Hutchens contends that the trial court erred in denying its request for attorney fees under § 18-17-2011. We reject this contention.
Section 18-17-201 creates an automatic right to attorney fees when a plaintiffs tort action is dismissed under C.R.C.P. 12(b):
*287In 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.
This provision is in derogation of the common law American Rule that requires parties to bear their own legal expenses. See In re Estate of Klarner, 113 P.3d 150, 157 (Colo.2005) (Colorado follows the American Rule). Therefore, this provision must be strictly construed. See City of Wheat Ridge v. Cerveny, 913 P.2d 1110, 1114 (Colo.1996) (in light of the American Rule, fee-shifting provision will not be construed as mandatory unless its directive is specific and clear); see also Maschhoff v. Klockenkemper, 343 Ill.App.3d 500, 278 Ill.Dec. 402, 798 N.E.2d 786, 788 (2003) (because award of attorney fees and costs is in derogation of the American Rule, statutes permitting such awards generally are to be strictly construed).
By its terms, § 18-17-2011 authorizes an award of attorney fees only when an "action is dismissed on motion of the defendant prior to trial under rule 12(b)." Thus, the statute does not authorize recovery if a defendant obtains dismissal of some, but not all, of the plaintiff's tort claims. See, eg., Berg v. Shapiro, 36 P.3d 109, 113 (Colo.App.2001). Similarly, the statute does not authorize recovery if one of the plaintiff's tort claims is rejected for reasons other than dismissal under C.R.C.P. 12(b). See Barton v. Law Offices of John W. McKendree, 126 P.3d 313, 314 (Colo.App.2005) (no recovery where one of the tort claims was dismissed for failure to file certificate of review); First Interstate Bank v. Berenbaum, 872 P.2d 1297, 1302 (Colo.App.1993) (no recovery where one of the tort claims was disposed of on summary judgment).
We conclude that a defendant may not recover attorney fees under § 18-17-201 when (1) the plaintiff's action includes both tort and nontort claims and (2) the defendant has obtained dismissal of the tort claims, but not of the nontort claims, under C.R.C.P. 12(b). In our view, dismissal of less than the entire "action" is insufficient to trigger an award under the plain language of the statute. Had the legislature intended to authorize recovery for something other than dismissal of the entire action, it would have employed different language. (An example of such language may be found in § 18-17-102(2), C.R.S.2006, which authorizes an award of attorney fees "against any attorney or party who has brought or defended a civil action, either in whole or in part, that the court determines lacked substantial justification" (emphasis added).)
Hutchens argues that we must construe § 18-17-201 to apply in these circumstances because a contrary interpretation will encourage plaintiffs to add nontort claims artificially, simply to avoid potential attorney fee awards. Because we must apply the statute as written, we are not persuaded by this policy argument. Moreover, if a plaintiff were to add baseless nontort claims solely to defeat a potential fee award under $ 183-17-201, it would risk sanctions under § 13-17-1022) or C.R.C.P. 11.
Because the trial court did not dismiss the entire action against Hutchens under C.R.C.P. 12(b), it properly declined to award attorney fees under § 18-17-201. See Rector v. City & County of Denver, 122 P.3d 1010, 1018 (Colo.App.2005) (no recovery under § 1317201 where declaratory and injunce-tive relief claims should not have been dismissed); Jaffe v. City & County of Denver, 15 P.3d 806, 814 (Colo.App.2000) (no recovery under § 1817201 where trial court dismissed tort claims pursuant to C.R.C.P. 12(b) and disposed of § 1988 claim, to which § 183-17-201 did not apply, on summary judgment).
IIL
Hutchens also contends that, after dismissing the tort claims, the trial court erroneously declined to award costs under § 18-16-107. We find no error.
Section 18-16-107 provides: "If, in any action, judgment upon motion to dismiss by either party to the action is given against the plaintiff, the defendant shall recover costs against the plaintiff; if such judgment is *288given for the plaintiff, he shall recover costs against the defendant."
This provision does not merely authorize a discretionary award of costs. Instead, it mandates an award of costs when either party obtains "judgment upon motion to dismiss." (In this regard, the provision is different from §§ 18-16-108 and 183-16-109, C.R.S.2006, which authorize an award of costs in "the discretion of the court.")
Here, the trial court did not enter judgment upon Hutchens's motion to dismiss. Therefore, the court lacked authority to award costs under § 18-16-107.
The trial court subsequently entered judgment in favor of Hutchens after Crane Service voluntarily dismissed its claim for breach of contract. We do not consider whether this action entitled Hutchens to an award of costs as the prevailing party under C.R.C.P. 54(d) because the record contains no indication that Hutchens requested such an award.
IV.
Citing C.A.R. 39.5, Hutchens requests an award for attorney fees incurred in prosecuting this appeal. Because we uphold the trial court's order, we deny this request.
The order is affirmed.
Judge DAILEY and JUDGE GRAHAM coneur.