Louis_Frolio
Databricks Employee
Databricks Employee

Greetings @charl-p-botha, I did some digging and here is what I found.

This is a UI-path issue, not a limitation on scalar functions. The current docs say Genie supports both scalar and table-valued Unity Catalog functions, and the Aug 27 release note says both can be attached to a Genie Agent. Credit to @ThomazNeto for reproducing this on a separate Azure workspace and to @ivanvyd for pointing at the documented route. Between them they nailed the distinction:

  • Configure > Sources > Add > SQL function is the "verified answers" dialog. It only accepts table-valued functions, which is where "You must select a function that returns a table" comes from.
  • Configure > Examples > Add is the documented path for SQL functions, and it accepts scalars.

So you can skip the table wrapper. Add the scalar through Examples and fill in Usage Guidance so Genie knows when to call it, what the parameters mean, and what the result represents. Two things to check while you're there: the function needs a real COMMENT, since Genie can't read the body and only reasons over the description, and agent users need EXECUTE on the function in Unity Catalog.

One testing note from Ivan worth repeating: your function's description already contains "42", so Genie answering 42 doesn't prove it ran the function. Use "Show code" on a SQL response, or "Show more" on a trusted-function response in Chat mode, to confirm the call happened.

If the Examples path also rejects it, that's the thing to escalate. Give your account team the cloud/region, the CREATE FUNCTION statement, DESCRIBE FUNCTION EXTENDED output, the navigation path, and the screenshot. Either way, I'd mention the Sources dialog to them as well. A menu entry labeled "SQL function" that rejects scalars with a message implying they aren't supported at all is going to catch more people than just you.

References:
Tune Genie Agent quality (SQL functions): https://docs.databricks.com/aws/en/genie-agents/tune-quality#how-does-genie-use-sql-functions
AI/BI release notes 2026 (Aug 27 note): https://docs.databricks.com/aws/en/ai-bi/release-notes/2026
Azure version of the tune-quality page: https://learn.microsoft.com/en-us/azure/databricks/genie-agents/tune-quality

Regards, Louis.