Requires Attunement.
Ordinary and giant rats are Indifferent to you (won't attack unless you threaten or harm them) while the pipes are on you.
Charges. 3 charges; regain daily at dawn. Play the pipes (Magic action), then a Bonus Action to expend 1–3 charges — each calls one Swarm of Rats if enough rats are within 1/2 mile (GM's call; else the charge is wasted). Called swarms move toward the music by the shortest route but aren't otherwise controlled.
Sway a swarm. When an uncontrolled Swarm of Rats comes within 30 ft while you play, it makes a DC 15 Wis save. Success: unaffected, immune to the pipes for 24 hr. Failure: Friendly to you and allies while you keep playing each round (Magic action) and obeys your commands (defends itself if none given). Control ends — and the swarm is immune for 24 hr — if it starts its turn more than 30 ft from you.