
    Linda GRANT, Plaintiff-Appellant, v. COUNTY OF ERIE, Erie County Youth Detention Services, Defendants-Appellees.
    No. 13-451-cv.
    United States Court of Appeals, Second Circuit.
    Oct. 17, 2013.
    
      Harvey P. Sanders, Sanders & Sanders, Cheektowaga, NY, for Appellant.
    
      Alisa A. Lukasiewicz, Craig R. Bucki, Phillips Lytle, LLP, Buffalo, NY, for Ap-pellees.
    Present: PIERRE N. LEVAL, PETER W. HALL, RAYMOND J. LOHIER, JR., Circuit Judges.
   SUMMARY ORDER

Appellant Linda Grant appeals from the Decision and Order entered on January 2, 2013 dismissing her Complaint pursuant to Fed.R.Civ.P. 12(b)(6). Grant’s complaint alleged violations of the Americans with Disabilities Act (“ADA”), New York State Human Rights Law (“NYHRL”), and the Age Discrimination in Employment Act (“ADEA”). We assume the parties’ familiarity with the underlying facts, the procedural history of this case, and the issues on appeal.

We review de novo the district court’s decision to grant a Rule 12(b)(6) motion to dismiss for failure to state a claim, accepting all factual allegations in the complaint as true and drawing all reasonable inferences in the plaintiffs favor. ATSI Commc’ns, Inc. v. Shaar Fund, Ltd., 493 F.3d 87, 98 (2d Cir.2007). “To survive a motion to dismiss, a complaint must contain sufficient factual matter, accepted as true, to state a claim to relief that is plausible on its face.” Ashcroft v. Iqbal, 556 U.S. 662, 678, 129 S.Ct. 1937, 173 L.Ed.2d 868 (2009) (internal quotation marks omitted). In its review, the court is entitled to consider facts alleged in the complaint and documents attached to it or incorporated in it by reference, documents “integral” to the complaint and relied upon in it, and facts of which judicial notice may properly be taken under Rule 201 of the Federal Rules of Evidence.

This Circuit has recognized an exception to the rule that a court must accept all factual assertions as true when attenuated allegations supporting the claim are contradicted by more specific allegations in the Complaint or when a claim is based on wholly conclusory and inconsistent allegations. See Hirsch v. Arthur Andersen & Co., 72 F.3d 1085, 1095 (2d Cir.1995), Salahuddin v. Jones, 992 F.2d 447, 449 (2d Cir.1993). That exception, however, does not obtain in this case. The district court determined that it need not accept as true Grant’s claim that a “fourth doctor ... cleared [her] to return to work” because in the district court’s view this allegation was contradicted by that doctor’s (Dr. Berger-on’s) opinion “that it is not appropriate for her to return ... to full duty [ — ] without restriction [ — to] the type of work where she would have to restrain physically strong people.” On that basis the district court granted the County’s motion to dismiss for failure to state a plausible claim of discrimination, reasoning that the complaint and the documents on which it relied did not establish that Grant was qualified to perform the essential functions of her job — a necessary element to make out her claim for discrimination. See Kinneary v. City of New York, 601 F.3d 151, 156 (2d Cir.2010).

Dr. Bergeron, however, found that Grant was qualified to perform the functions of her job. The report concludes that, “from an orthopedic stand point, ... [Grant] could return to her regular work ... [and] would be able to defend herself.” It is true that the report goes on to question whether it is “reasonable” to return her to work given her age and medical history and opines that this would not be “appropriate.” But Dr. Bergeron’s reason for raising these questions is concern that Grant may reinjure herself, not that she lacks the qualifications to perform her job. Dr. Bergeron’s report, accordingly, does not support the district court’s conclusion of Grant’s lack of qualification to perform her work duties. Because Dr. Bergeron’s report states that Grant is able to perform the essential functions of her job, it cannot serve as the basis for dismissing her claim of discrimination at this stage in the litigation. We thus vacate that portion of the judgment that dismisses the complaint on the ground that Grant is no longer qualified to return to her job.

Regarding the dismissal of Grant’s New York state law claims on the ground that the notice of claim was inadequate, a district court may dismiss an action sua sponte for failure to state a claim so long as the plaintiff is given notice of the grounds for dismissal and an opportunity to be heard. Thomas v. Scully, 943 F.2d 259, 260 (2d Cir.1991). Here, the County did not assert inadequate notice of claim as an affirmative defense, nor did the County advance an argument to this effect in its principal memorandum or reply memoi'an-dum in support of its motion to dismiss. By raising the issue sua sponte and determining the motion to be “fully briefed and oral argument unnecessary,” the district court denied Grant notice and an opportunity to be heard on the very ground on which it ultimately dismissed the state law claims. For that reason, the district court erred in dismissing Grant’s New York state law discrimination and retaliation claims for failure to file and serve a notice of claims. See Id. (“Though the district court has the power to dismiss a complaint sua sponte for failure to state a claim on which relief can be granted, it may not properly do so without giving the plaintiff an opportunity to be heard.”); Wachtler v. County of Herkimer, 35 F.3d 77, 82 (2d Cir.1994) (“The district court has the power to dismiss a complaint sua sponte for failure to state a claim ... so long as the plaintiff is given notice and an opportunity to be heard.”) (internal quotation marks omitted). The portion of the judgment dismissing the state law claims is also vacated.

We affirm that portion of the judgment that dismissed Grant’s retaliation claim. On the facts pleaded, Grant failed to demonstrate that she had engaged in a protected activity that then subjected her to retaliation. Even assuming her EEOC filing was an adequately pleaded protected activity that formed the basis for the alleged retaliation, there could be no causal connection between it and the adverse employment action from which a reasonable jury could infer retaliatory intent. See Treglia v. Town of Manlius, 313 F.3d 713, 719 (2d Cir.2002). Grant made no complaints directly to the County, nor did she make any complaints about any discrimination by the County prior to her filing a charge with the EEOC on July 16, 2010. Her adverse job action had already taken place months before she filed the discrimination charge with the EEOC.

For the reasons stated, the judgment of the district court is AFFIRMED in part, and VACATED and REMANDED in part, for proceedings consistent with this decision. 
      
      . See Rothman v. Gregor, 220 F.3d 81, 88 (2d Cir.2000) (“[F]or purposes of a motion to dismiss, we have deemed a complaint to include any written instrument attached to it as an exhibit or any statements or documents incorporated in it by reference ...”); Int’l Audiotext Network, Inc. v. Am. Tel. & Tel. Co., 62 F.3d 69, 72 (2d Cir.1995) ("[Ajlthough the amended complaint in this case does not incorporate the Agreement, it relies heavily upon its terms and effect; ... [t]he Agreement is ‘integral’ to the complaint, and we consider its terms in deciding whether [plaintiff] can prove any set of facts that would entitle it to relief”); Brass v. Am. Film Techs., Inc., 987 F.2d 142, 150 (2d Cir.1993) (in determining the adequacy of a claim under Rule 12(b)(6), consideration is limited to facts stated on the face of the complaint, in documents appended to the complaint or incorporated in the complaint by reference, and matters of which judicial notice may be taken).
     