In the course of a dispositional hearing on a child in need of services (CHINS) proceeding,3 a judge of the Juvenile Court declared unconstitutional a Worcester school committee policy expelling any high school student bringing a weapon onto school premises. He ordered the school committee to reinstate a juvenile who had been suspended for one year in accordance with that policy. As the school committee and the superintendent of schools (superintendent) were not parties to that case, they filed a complaint pursuant to G. L. c. 211, § 3 (1990 ed.), seeking a stay of the order.4 A single justice stayed that order, and the case was reserved and reported to the full court. We conclude that the Juvenile Court judge lacked the authority to issue the order.
The Worcester Juvenile Court case began as a proceeding to determine whether a high school student was a “child in need of services” within the meaning of G. L. c. 119, § 21 (1990 ed.). A complaint alleging that the student was a “child in need of services” was filed pursuant to G. L. c. 119, § 39E (CHINS petition) in February, 1990. In October, 1990, the juvenile, a ninth grade student at a public high school in Worcester, was discovered to be in possession of a knife on school premises. Before the 1990-1991 school year began, the school committee had adopted a rule providing that any high school student bringing a weapon onto school *833premises would be suspended for a minimum of twelve months. A hearing was held, at which the juvenile, her foster mother, and the principal of the school testified. The school committee then voted to suspend the juvenile for one year. In November, 1990, a hearing was held on the CHINS petition, and the court determined that the juvenile was “in need of services.” The court held a dispositional hearing as part of the CHINS proceeding in December, 1990.
The chairman of the school committee and the superintendent were subpoenaed to testify as witnesses at the CHINS dispositional hearing. The judge questioned these witnesses at length about the details of the policy. A Department of Social Services employee testified as to the juvenile’s options during the suspension period: she could apply for a special needs evaluation, attend a private school, or attend public school in another school district. The school committee chairman also testified that, following the suspension, a student is offered extra tutoring and summer school to aid in catching up. Following the hearing, the Juvenile Court judge issued a dispositional order in the CHINS proceeding ordering that the juvenile was to continue to reside with her father, and ordering the school committee and the superintendent to reinstate the juvenile immediately and to provide her with remedial instruction. The judge based his reinstatement order on his conclusion that the school committee’s action in expelling the juvenile for a year was invalid as a matter of State constitutional law.
The plaintiffs filed motions before the Juvenile Court judge requesting a stay of the order pending appeal and requesting amendment of the order deleting references to the plaintiffs. The judge denied the motions. The school committee and the superintendent then filed the present complaint pursuant to G. L. c. 211, § 3, naming the Juvenile Court judge as defendant. See note 2, supra. The complaint requested a stay of the order and reversal of those portions of the order that related to the school committee. A single justice stayed the order. In March, 1991, another single justice reserved and reported the case, without decision, to this court.
*8341. Review, pursuant to G. L. c. 211, § 3. In general, “[t]he supervisory power of this court is used sparingly. . . .” Parents of Two Minors v. Bristol Div. of the Juvenile Court Dep’t, 397 Mass. 846, 849 (1986), quoting Soja v. T.P. Sampson Co., 373 Mass. 630, 631 (1977). However, we agree with the plaintiffs’ assertion that this is an appropriate case in which to exercise that power. The plaintiffs were not parties to the CHINS proceeding. General Laws c. 119, § 391 (1990 ed.), provides a right of appeal for a child who is adjudicated in need of services. Section 391 does not provide an avenue of relief to the school committee or the superintendent. In these circumstances, we consider that review under c. 211, § 3, is appropriate. See Parents of Two Minors, supra at 849-850. See also Commonwealth v. Gordon, ante 498, 499 (1991).
2. Authority of the Juvenile Court to issue the order. The plaintiffs contend that the Juvenile Court judge acted beyond his authority when he found the school committee policy to be unconstitutional and ordered the school committee to reinstate the juvenile. The Juvenile Court argues that Juvenile. Court jurisdiction supporting the ruling is provided by G. L. c. 119, § 39G, or, alternatively, by G. L. c. 218, § 59 (1990 ed.). We do not agree.
We examine the arguments put forth by the Juvenile Court to determine whether, in this particular case, the jurisdiction of the Juvenile Court extends to the ruling that was made. “The Juvenile Courts, like all the courts of the Commonwealth, except the Supreme Judicial Court, are creatures of the Legislature and derive their powers, other than those powers that are inherent in all courts, . . . from the Legislature” (citations omitted). Parents of Two Minors, supra at 851. Legislative grants of power “must either be articulated expressly or be capable of being deduced by ‘necessary and inevitable’ implication.” Police Comm’r of Boston v. Municipal Court of the Dorchester Dist., 374 Mass. 640, 663 (1978), quoting Mountfort v. Hall, 1 Mass. 443, 457 (1805). Parents of Two Minors, supra at 851. Implied powers have been recognized as “inherent” in courts where the power is *835necessary to allow the court to function. Police Comm’r of Boston, supra at 664, citing O’Coin’s, Inc. v. Treasurer of the County of Worcester, 362 Mass. 507 (1972). Implied powers also have been recognized as ancillary to a specific grant of jurisdiction, where the power is necessary so as not to “deny the existence of a jurisdiction which was intended by the Legislature to be given.” Police Comm’r of Boston, supra at 663, quoting Commonwealth v. New York Cent. & H.R. R.R., 206 Mass. 417, 429 (1910). “The primary purpose of recognizing ancillary jurisdiction is to ensure that a particular court judgment is given complete and final effect.” Police Comm’r of Boston, supra at 664.
“[Wjithin their respective jurisdictions,” the Juvenile Courts have the same powers as the District Courts. G. L. c. 218, § 59 (1990 ed.). The Juvenile Courts thus have exclusive jurisdiction “over cases of juvenile offenders under seventeen and cases of neglected, wayward or delinquent children” and cases referred to them under G. L. c. 211, § 4A. See G. L. c. 218, § 60 (1990 ed.); Parents of Two Minors, supra at 852. The Juvenile Courts also have full equity jurisdiction “in all cases and matters arising under [c. 119].” G. L. c. 218, § 59 (1990 ed.).
The judge issued the ruling challenged here in the course of a CHINS proceeding conducted pursuant to G. L. c. 119, § 39G.5 This section authorizes the court to adjudge the juvenile to be “in need of services” and, “taking into consideration the physical and emotional welfare of the child” to make “any of the following orders of disposition: (a) subject to any conditions and limitations the court may prescribe, including provision for . . . educational . . . services . . . permit the child to remain with his parents; (b) . . . place the child in the care of any of the following [qualified individuals or agencies]; or (c) . . . commit the child to the department of social services.” G. L. c. 119, § 39G (1990 ed.).
*836The Juvenile Court asserts first that the plain language of § 39G provides jurisdiction for the ruling. The Juvenile Court points to the authorization to issue a dispositional order, the authorization to condition such an order on the provision of educational services, and the authorization to consider the welfare of the juvenile in making the order. The Juvenile Court argues that this combination results in an authorization to inquire into the validity of any obstacle to the delivery of services to the juvenile and to issue any order necessary to remove an obstacle. We recently have considered the language of § 39G in assessing the validity of another order issued under that section. See Matter of Vincent, 408 Mass. 527 (1990). We held in that case that § 39G authorized the judge to make an order determining the custody of a juvenile, and to make the custody subject to various conditions, but that § 39G does not authorize a judge to order a juvenile directly to attend school. Id. at 531-532. Similarly, we conclude here that the language of § 39G authorizing a judge to make orders determining custody and placing limitations on custody is not sufficiently broad to authorize a judge to raise and rule on the constitutionality of a school committee policy and then to order the school committee directly to reinstate an expelled juvenile on that basis. See id.
The Juvenile Court argues further that, even if authorization to issue this order does not appear in the language of § 39G, such power is implied by the language of the provision in combination with the legislative intent behind it. The Juvenile Court relies heavily on Police Comm’r of Boston, supra, in which we held that a Juvenile Court has the power to order police to expunge certain records of juveniles. In that case, we determined that “the power to order expungement or its equivalent, ... is a power that properly may be exercised by the courts of the Commonwealth as a necessary adjunct to their exercise of judicial power” (footnote and citation omitted). Police Comm’r of Boston, supra at 661. We then examined the language of G. L. c. 119, §§ 52-63, which govern delinquency proceedings against juveniles, to determine whether a fair reading of the applicable statutes re*837vealed an implied power in the Juvenile Court to order ex-pungement of juvenile police records. We noted the broad language of c. 119, § 53, directing that the statute governing delinquency proceedings be liberally construed, and that the juveniles not be treated as criminals. After examining that language, and other sections relating to delinquency proceedings, we concluded that the delinquency proceeding statutes implied that the Juvenile Court had the power to order ex-pungement of juvenile records.
The case before us arises, however, under different statutory provisions. The provisions governing CHINS proceedings, G. L. c. 119, §§ 39E-39I, outline the procedure for adjudicating a child “in need of services” and authorize the court to make custody orders subject to limitations, but do not contain the broad language contained in G. L. c. 119, § 53. See Matter of Vincent, supra. Furthermore, the circumstances of this case do not support the contention that the Juvenile Court had inherent power to make this ruling because it could not otherwise fulfil its judicial function. The judge’s findings of fact recite three options for continuing her schooling which are open to the juvenile: she can attend a private school, she can move into another school district, or she can request evaluation as a special needs student. The record does not disclose any fact permitting a determination that the three options are insufficient to meet the needs of this juvenile. .The judge could have fulfilled his duty in the CHINS proceeding by incorporating one of those options into his dispositional order. The school committee has never declined to educate the juvenile. It merely bars the use of the Worcester public schools, where the infraction took place, for one year. Therefore, no inherent power allowed the court to exceed the authority granted in § 39G. See Parents of Two Minors, supra at 853. Because the power to determine the constitutionality of a school committee policy and to issue an order to the school committee is not inherent in the court and is not necessarily and inevitably implied by G. L. c. 119, §§ 39E-39I, see Police Comm’r of Boston, supra at 663, the Ju*838venile Court exceeded its jurisdictional power in issuing the order.
Other cases cited by the Juvenile Court are not to the contrary. We have held that c. 119, §§ 24 and 26, implicitly authorize a judge to order a hospital to enter a “no code” order for an infant, Custody of a Minor (No. 1), 385 Mass. 697 (1982), and to order parents to allow their child to undergo chemotherapy, Custody of a Minor, 375 Mass. 733 (1978). However, § 26 authorizes a court to “make any other appropriate order with reference to the care and custody of the child as may conduce to his best interests.” G. L. c. 119, § 26 (1990 ed.). The CHINS provisions do not contain this broad language. Furthermore, the orders issued in the above cited cases did not depend on a prior constitutional ruling affecting parties not before the court. The cases are thus inapposite.
The Juvenile Court argues that the equity jurisdiction conferred by G. L. c. 218, § 59, provides a separate, alternate source of authority for the judge’s order. That equity jurisdiction, however, is limited to “cases and matters arising under the provisions of [c. 119].” G. L. c. 218, § 59 (1990 ed.). As we stated above, the section of c. 119 under which this case arose concerns only orders of disposition, and does not authorize the court to examine the constitutionality of a school committee policy. The grant of equitable powers under c. 218, § 59, does not permit a Juvenile Court to extend its jurisdiction beyond the limits established by c. 119.
Finally, the Juvenile Court argues that judicial economy would be best served by determining the validity of the school committee policy when a juvenile affected by the policy is before the court. While “practical considerations in favor of judicial economy and against piecemeal litigation” play some role in determining the extent of a court’s ancillary jurisdiction, Police Comm’r of Boston, supra at 664, those considerations are not relevant in this case. It would be specious economy to decide a constitutional issue in the absence of necessary parties and a factual record. See School Comm. of Springfield v. Board of Educ., 362 Mass. 417, 445 *839(1972). See also Worcester Vocational Teachers Ass’n v. Worcester, 13 Mass. App. Ct. 1, 8 (1982).
The case is remanded to single justice. A judgment shall be entered directing the Juvenile Court to vacate the portions of the order which refer to the plaintiffs, and to proceed in a manner consistent with this opinion.
So ordered.
Pursuant to G. L. c. 119, § 21 (1990 ed.).
The superintendent and the school committee did not name the juvenile as a party in their complaint. The juvenile did file a brief and at oral argument her attorney argued in favor of the ruling.
Because the school committee and the superintendent were not parties to that proceeding, they argue the order was unconstitutional. On the result we reach, we need not consider their arguments concerning lack of adequate notice and due process.