How to toggle a switch or light?

Noob question:

I have a lamp. I want to say “Alexa, lamp.” and have it toggle states. If it’s on, I want it to turn off. And vice-versa.

Much more efficient than saying, “Alexa, turn off the lamp”

How do I do that? I tried saying “toggle lamp” but that’s not recognized. I feel like it’s probably very simple.

There are a couple ways to add voice intents for Alexa. If you want something that succinct, I think you are limited to using a Routine in the Alexa app. If there is only one “lamp” you can handle that directly in the routine, otherwise you will need to point the routine at a script that can handle the necessary logic to match the active room with the lamp.

Ah got it. Made a routine and it allows the entity to be toggled. Not sure why toggle isn’t a built-in intent. It’s a pretty basic action.