Parks. Go to Retiro park. Boats, playgrounds for the kids. Prado museum is close by.
Also while huge, Caso de Campo park has a bunch of stuff for kids. Amusement park, zoo & aquarium. There is also a sky train that goes above the city:
https://www.esmadrid.com/en/tourist-...rico-de-madrid
I like the Palace and your child may like the armament part of it.