Alexa/Google calling HA scripts with entities and parameters?

We can do a simple call from GA, such as

Hey Google, Dim Kitchen to 50%

And the Kitchen lights get set to 50%. In this example we have a function Dim, an entity Kitchen (which really uses some Google/HA magic to find the entity_id from the name Kitchen) and a parameter 50. So, in pseudo code that might look like

setBrightness(id_kitchen, 50)

Or course GoogleAssistant actually calls some other HA function after verifying the entity is actually a light. I think. But what if I want to use GA to call a custom function Foobar, with the same parameters?

Ok Google, Foobar Kitchen to 50

And the pseudo code

Foobar(id_kitchen, 50)

Anyone figure this out? Without using IFFT?