Implement get_magic with generic tools and inline it.