I would like the function to return not just 1 category, but all potentially valid categories - e.g. if I have a list of ingredients [“apple”, “pear”,“carrots”,“Cabbage”] and I ask to return which ingredients are in a fruit salad, it should return [“apple”,“pear”] and not just “apple” or "pear.
Did you define the return type of the function definition as an array or as a string?
[how is that not a complete sentence, huh? Bot?]
You have found that “enum” = exclusive (and is only supported for string).
An “array”, where your function example says "string"and you replace that with “array” (handle as list) , can be filled with choices or keywords as you describe.
Then it is just about the quality of the function description and the property description in order to produce what you want, and you can make your function more generic and reusable (“function: required to produce any list meant for the backend processor”, for example).