Snowflake

Learn how to use Snowflake with Composio

Overview

SLUG: SNOWFLAKE

Description

Snowflake is a cloud-based data warehouse offering elastic scaling, secure data sharing, and SQL analytics across multiple cloud environments

Authentication Details

client_id
stringRequired
client_secret
stringRequired
oauth_redirect_uri
stringDefaults to https://backend.composio.dev/api/v1/auth-apps/add
scopes
stringDefaults to refresh_token
subdomain
stringRequired

Connecting to Snowflake

Create an auth config

Use the dashboard to create an auth config for the Snowflake toolkit. This allows you to connect multiple Snowflake accounts to Composio for agents to use.

1

Select App

Navigate to Snowflake.

2

Configure Auth Config Settings

Select among the supported auth schemes of and configure them here.

3

Create and Get auth config ID

Click “Create Snowflake Auth Config”. After creation, copy the displayed ID starting with ac_. This is your auth config ID. This is not a sensitive ID — you can save it in environment variables or a database. This ID will be used to create connections to the toolkit for a given user.

Connect Your Account

Using OAuth2

1from composio import Composio
2
3# Replace these with your actual values
4snowflake_auth_config_id = "ac_YOUR_SNOWFLAKE_CONFIG_ID" # Auth config ID created above
5user_id = "0000-0000-0000" # UUID from database/application
6
7composio = Composio()
8
9
10def authenticate_toolkit(user_id: str, auth_config_id: str):
11 connection_request = composio.connected_accounts.initiate(
12 user_id=user_id,
13 auth_config_id=auth_config_id,
14 )
15
16 print(
17 f"Visit this URL to authenticate Snowflake: {connection_request.redirect_url}"
18 )
19
20 # This will wait for the auth flow to be completed
21 connection_request.wait_for_connection(timeout=15)
22 return connection_request.id
23
24
25connection_id = authenticate_toolkit(user_id, snowflake_auth_config_id)
26
27# You can also verify the connection status using:
28connected_account = composio.connected_accounts.get(connection_id)
29print(f"Connected account: {connected_account}")

Tools

Executing tools

To prototype you can execute some tools to see the responses and working on the Snowflake toolkit’s playground

For code examples, see the Tool calling guide and Provider examples.

Tool List

Tool Name: Cancel Statement Execution

Description

Cancels the execution of a running SQL statement. Use this action to stop a long-running query.

Action Parameters

request_id
statementHandle
stringRequired

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Check Statement Status

Description

Retrieves the status of a previously submitted SQL statement. Replace '{statementHandle}' with the unique identifier of the statement.

Action Parameters

partition
requestId
statementHandle
stringRequired

Action Response

code
stringRequired
data
error
message
stringRequired
statementHandle
stringRequired
statementStatusUrl
stringRequired
successful
booleanRequired

Tool Name: Execute SQL

Description

Tool to execute a SQL statement and return the resulting data. Use when you need to query data from Snowflake.

Action Parameters

bindings
database
parameters
role
schema_name
statement
stringRequired
timeout
warehouse

Action Response

data
arrayRequired
error
successful
booleanRequired

Tool Name: Fetch Catalog Integration

Description

Fetches details of a specific catalog integration.

Action Parameters

name
stringRequired

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Get Active Scheduled Maintenances

Description

Retrieves a list of any active scheduled maintenances currently in the In Progress or Verifying state.

Action Parameters

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Get All Scheduled Maintenances

Description

Retrieves a list of the 50 most recent scheduled maintenances, including those in the Completed state.

Action Parameters

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Get Component Status

Description

Retrieves the status of individual components, each listed with its current status.

Action Parameters

limit

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Get Status Rollup

Description

Retrieves the status rollup for the entire page, including indicators and human-readable descriptions of the blended component status.

Action Parameters

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Get Status Summary

Description

Retrieves a summary of the status page, including status indicators, component statuses, unresolved incidents, and upcoming or in-progress scheduled maintenances.

Action Parameters

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Get Unresolved Incidents

Description

Retrieves a list of any unresolved incidents currently in the Investigating, Identified, or Monitoring state.

Action Parameters

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Get Upcoming Scheduled Maintenances

Description

Retrieves a list of any upcoming scheduled maintenances still in the Scheduled state.

Action Parameters

test_id

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Show Databases

Description

Lists all databases for which you have access privileges. Shows database metadata including name, creation date, owner, retention time, and more. Can filter results and include dropped databases within Time Travel retention period.

Action Parameters

from_name
history
like_pattern
limit
role
starts_with
terse
timeout
warehouse

Action Response

columns
data
arrayRequired
error
successful
booleanRequired

Tool Name: Show Schemas

Description

Lists all schemas for which you have access privileges. Shows schema metadata including name, creation date, owner, database, retention time, and more. Can filter results and include dropped schemas within Time Travel retention period.

Action Parameters

database
from_name
history
in_scope
like_pattern
limit
role
starts_with
terse
timeout
warehouse

Action Response

columns
data
arrayRequired
error
successful
booleanRequired

Tool Name: Show Tables

Description

Lists all tables for which you have access privileges. Shows table metadata including name, creation date, owner, database, schema, row count, size in bytes, clustering keys, and more. Can filter results and include dropped tables within Time Travel retention period.

Action Parameters

database
from_name
history
in_scope
like_pattern
limit
role
schema
starts_with
terse
timeout
warehouse

Action Response

columns
data
arrayRequired
error
successful
booleanRequired

Tool Name: Submit SQL Statement

Description

Submits a SQL statement for execution.

Action Parameters

bindings
database
parameters
role
schema
statement
stringRequired
timeout
Defaults to 604800
warehouse

Action Response

code
stringRequired
createdOn
integerRequired
data
error
message
stringRequired
resultSetMetaData
sqlState
stringRequired
statementHandle
stringRequired
statementHandles
statementStatusUrl
stringRequired
stats
successful
booleanRequired