Search Snowflake with SQL
The Search Snowflake with SQL tool lets Glean agents run direct, read-only SQL against Snowflake and return the results to downstream steps.
Use this tool when you want full control over the SQL being executed while still composing the response in a Glean agent (for example, summarizing the data, sending a message, or updating another system).
Limitations
-
The tool validates SQL to prevent writes and relies on Snowflake role permissions.
-
If no warehouse is provided, no default warehouse is configured in the tool setup, and the user has no default warehouse in Snowflake, the tool fails.
-
Missing privileges return authorization or object does not exist errors.
-
Snowflake errors surface back to the agent run and this is dependent on Snowflake service health.
Prerequisites
-
An admin has enabled and configured Snowflake tools in the Glean Admin Console.
-
Snowflake role and permissions
-
A Snowflake role, for example,
GLEAN_QUERY_SNOWFLAKE_ROLEwith at least:-
USAGEon target databases and schemas. -
SELECTon the tables or views referenced in your SQL. -
USAGEon the warehouse used by the tool.
-
-
-
User authentication
- Users who run this tool have authenticated to Snowflake via OAuth from Glean.
Supported parameters
| Parameter | Type | Required | Recommended source | Description |
|---|---|---|---|---|
| Query | String | Yes | Dynamic (user input or step) | Full read-only SQL statement to execute (for example, SELECT COUNT(*) FROM ANALYTICS.CUSTOMERS LIMIT 5). |
| Warehouse | String | No | Fixed in step configuration | Snowflake warehouse to execute the SQL. If omitted, the tool uses the default warehouse configured in the tool setup. If no default is configured, the tool uses the user's Snowflake default warehouse. |
Usage example
Scenario: Simple reporting query
Goal: run a fixed report query and present results in the agent response.
Setup in Agent Builder:
-
Add a trigger step, for example, an input form with a query in the text field.
-
Add the Search Snowflake with SQL tool and configure:
-
Query: a fixed SQL statement, for example,
SELECT COUNT(*) AS customer_count FROM ANALYTICS.CUSTOMERS. -
Warehouse: a reporting warehouse your role can use.
-
-
Add a Respond step to display the results as a table or summary.
Resulting behavior:
-
The tool executes the SQL in Snowflake and returns the result set.
-
The Respond step formats or summarizes the output.