
99 Cal.App.3d 398 (1979)
160 Cal. Rptr. 274
FRED MAURICE ANDERSON, Petitioner,
v.
THE JUSTICE COURT FOR THE SAN BENITO JUDICIAL DISTRICT OF SAN BENITO COUNTY, Respondent; THE PEOPLE, Real Party in Interest.
Docket No. 46893.
Court of Appeals of California, First District, Division Four.
December 5, 1979.
*399 COUNSEL
Edward C. Bell for Petitioner.
No appearance for Respondent.
George Deukmejian, Attorney General, Robert H. Philibosian, Chief Assistant Attorney General, Edward P. O'Brien, Assistant Attorney General, Ronald E. Niver and Herbert F. Wilkinson, Deputy Attorneys General, for Real Party in Interest.
*400 OPINION
CALDECOTT, P.J.
The basic issue presented by this petition is whether the justice court or the superior court has the jurisdiction under Penal Code section 987.9 to grant funds to an indigent defendant to be used in the preparation of his defense. We hold that the jurisdiction lies with the superior court.
Petitioner, Fred Maurice Anderson, seeks a writ of mandamus directing the Justice Court of San Benito County to grant his motion pursuant to Penal Code section 987.9. On March 27, 1979, a verified complaint was filed in the Justice Court of San Benito County, charging petitioner with violation of four counts of Penal Code section 187 (murder) with special circumstances pled as to each count, Penal Code section 190.2, subdivision (a).
On April 16, 1979, petitioner filed a motion requesting $10,000 pursuant to Penal Code section 987.9, which provides for funds for payment of investigators, experts and others in the preparation and presentation of the defense in the trial of an indigent defendant in a capital case. The magistrate denied petitioner's motion for funds on the ground that the justice court was without jurisdiction to grant the motion and that jurisdiction rested with the trial court.
On April 30, petitioner secured an alternative writ of mandamus from the superior court, restraining the magistrate from proceeding with the preliminary hearing, ordering him to show cause why he should not be compelled to award said monies under Penal Code section 987.9.
On May 15, 1979, the alternative writ was discharged and the petition for writ was denied by the superior court. The court advised petitioner's attorney to petition the superior court for funds, which would be advanced in the sum of $2,500 upon an appropriate showing. However, counsel declined that opportunity.
The present petition was filed and this court issued its alternative writ on August 20, 1979.


*401 I
Penal Code section 987.9 provides that: "In the trial of a capital case the indigent defendant, through his counsel, may request the court for funds for the specific payment of investigators, experts, and others for the preparation or presentation of the defense. The application for such funds shall be by affidavit and shall specify that the funds are reasonably necessary for the preparation or presentation of the defense. The fact that such an application has been made shall be confidential and the contents of the application shall be confidential. Upon receipt of such application, a judge of the court, other than the trial judge presiding over the capital case in question, shall rule on the reasonableness of the request and shall disburse an appropriate amount of money to defendant's attorney. The ruling on the reasonableness of the request shall be made at an in camera hearing. In making such a ruling, the court shall be guided by the need to provide a complete and full defense for the defendant.
"At the termination of the proceedings, the attorney shall furnish to the court a complete accounting of all moneys received and disbursed pursuant to this section." (Italics added.)
The People do not contend that funding cannot be provided under section 987.9. Such a contention, if made, would be without merit. (1) It is settled that the state is required by the United States Constitution to provide counsel for indigent defendants. (Gideon v. Wainwright (1963) 372 U.S. 335 [9 L.Ed.2d 799, 83 S.Ct. 792, 93 A.L.R.2d 733].) The right to counsel includes the right to the use of any experts that will assist counsel in preparing a defense. (In re Ketchel (1968) 68 Cal.2d 397, 398 [66 Cal. Rptr. 881, 438 P.2d 625]; Torres v. Municipal Court (1975) 50 Cal. App.3d 778, 783 [123 Cal. Rptr. 553]; See 18 U.S.C.A. § 3006A (e); Mason v. State of Arizona (9th Cir.1974) 504 F.2d 1345, 1351.) The preliminary hearing is a critical stage of the criminal process at which the defendant is entitled to the aid of counsel. (Coleman v. Alabama (1970) 399 U.S. 1 [26 L.Ed.2d 387, 90 S.Ct. 1999].) At the preliminary hearing, the defendant "must be permitted, if he chooses, to elicit testimony or introduce evidence tending to overcome the prosecution's case or establish an affirmative defense." (Jennings v. Superior Court (1967) 66 Cal.2d 867, 880 [59 Cal. Rptr. 440, 428 P.2d 304].) It follows, therefore, that if expert or investigative help is necessary to the defense pending the preliminary hearing, due process requires the state to provide the service *402 to indigents. (Mason v. State of Arizona, supra, 504 F.2d 1345 at p. 1351; see also United States v. Bass (9th Cir.1973) 477 F.2d 723.)
(2) As pointed out by the People, the superior court is the only court with jurisdiction to entertain an application for funds under section 987.9. By the use of the word "trial" in the section, the Legislature indicated an intention that only the court with trial jurisdiction over the cause should have jurisdiction over the application for funds.
Also, the legal powers of a committing magistrate are extremely narrow. A magistrate has only such powers as are statutorily granted and it cannot be said that section 987.9 clearly grants this power to the magistrate.
Furthermore, as there may be more than one application for funds during the course of an action, administratively it is preferable to have all such applications heard by the same court. The court will have the full record before it of all applications filed, what funds were granted and for what specific purposes. Also the section provides, "At the termination of the proceedings, the attorney shall furnish to the court a complete accounting of all moneys received and disbursed pursuant to this section," and as the same court has heard all applications only one accounting will be required of the attorney.

II
In the instant case, petitioner allegedly filed a declaration in the justice court, stating that he has no money to pay his attorney and that his friends and family are paying him. Petitioner's counsel also allegedly filed a declaration alleging petitioner's indigency.
In the opposition to the petition, the People claim that petitioner is not an "indigent" within the meaning of section 987.9 since he is represented by retained rather than appointed counsel. In the return to the alternative writ, the People do not repeat this claim but state that the record is unclear as to the requirement of indigency.
The statute itself does not limit application to cases where counsel has been appointed but to "the indigent defendant." Neither case law nor the Penal Code defines the term "indigent defendant." For the purpose *403 of appointing counsel, the test is financial means to employ counsel.
In In re Johnson (1965) 237 Cal. App.2d 463, 467 [47 Cal. Rptr. 17], the court stated: "The right to court-appointed counsel is a conditional one; it exists only if the accused is financially unable to employ counsel. Accordingly, in this proceeding if the petitioner asserts his constitutional right to court-appointed counsel was infringed, it is incumbent upon him to allege or show that he was without ability to employ counsel since it must be made to appear that the right exists before there can be any claim of deprivation." (3) It follows that the test of indigency for the purpose of funding investigators and experts is financial means to secure these services. If the family and friends of a defendant have no legal duty to support him, their financial means would ordinarily be entirely irrelevant. The fact that they employed counsel for him or gave him money would be relevant to whether he could afford to obtain investigative services. It would, however, be only one of many facts the court would consider in determining the question of financial ability.
The alternative writ of mandate is discharged and the petition for a peremptory writ of mandate is denied without prejudice to petitioning the superior court for necessary funds.
Rattigan, J., and Christian, J., concurred.
