If she is in foster care she is a ward of the state and you would have to go through the dependency court and deal with CPS, as CPS is her legal guardian.
***Please be sure to mark if you find the answer "helpful" or a "best" answer. Thank you! I hope this helps. ******
You have to deal with the state foster care system. If she was living with you prior to foster care, the state would have looked at you as a possible resource. You either refused to have the child live with you or the state considered you not to be fit at the time. These are not easy cases and courts almost always follow what the state wants to do.
Sign up to receive a 5-part series of useful information and advice about child custody law.