Answer:
Sound is a mechanical wave, this means that it needs a medium in order to propagate.
If you put the toy inside a jar and you remove the air, then the sound of the toy will not have the air to travel. In another side, if the toy is touching the bottom of the jar, then the sound that the toy is making can travel along the same toy and then be transmitted to the jar that is being touched and the jar will transmit the sound to the air surrounding it.