iyashk-DB
Databricks Employee
Databricks Employee

In UC, the functions must be read-only; they cannot modify state (no INSERT, DELETE, MERGE, CREATE, VACUUM, etc). So I tried to create a PROCEDURE and call it; I was able to insert data into the table successfully.

Screenshot 2025-12-11 at 9.07.30 AM.png

Unity Catalog tools are really just Unity Catalog user-defined functions (UDFs) under the hood. So you can’t register a stored procedure as a UC function tool directly. However I can think of two quick options to make an agent perform writes:
1) Agent code tool: Define a tool in your agent’s code that executes a parameterized CALL … via the SQL Statement Execution API or Workspace client. Agent code tools are recommended for calling REST APIs or running arbitrary code and don’t require the operation to be wrapped as a UC function.

2) DBSQL MCP server (tool interoperability): Expose a general SQL execution tool via the Databricks-managed DBSQL MCP server and have the agent run parameterized SQL, including DML, under your governance model. Use this for pipeline authoring or when you want tool discovery via MCP; for read-only chatbot-style retrieval, use Genie instead.

If you must keep the tool in Unity Catalog for governance and discoverability, use UC functions for read/query tools and pair them with an agent code tool (or MCP SQL tool) for mutations. UC function tools are a great fit for retrieval/transform patterns, and Databricks explicitly supports using UC UDFs as agent tools.