Skip to content
Scalekit Docs
Talk to an Engineer Dashboard

Connect AI agents to Snowflake

Scalekit connector
Open markdown

The Snowflake connector lets your AI agent act in each user's Snowflake account. Each user signs in to Snowflake once, and Scalekit stores and refreshes their tokens, so your agent never handles credentials. It comes with 42 tools.

Tools
42
What they doRead · write · destructive
12 · 21 · 912 read21 write9 destructive
Users sign in with
OAuth app
Your own Snowflake app

Setup

  1. Install the SDK

    Terminal window
    npm install @scalekit-sdk/node dotenv
  2. Set your credentials

    Add your Scalekit credentials to your .env file. Find values in app.scalekit.com > Developers > API Credentials.

    .env
    SCALEKIT_ENVIRONMENT_URL=<your-environment-url>
    SCALEKIT_CLIENT_ID=<your-client-id>
    SCALEKIT_CLIENT_SECRET=<your-client-secret>
  3. Create the Snowflake connection

    In AgentKit > Connections, create a Snowflake connection and copy its redirect URI. The name you give it is the connection_name your code passes. See Configure connections.

  4. Register an OAuth app

    Snowflake connections use your own OAuth app. Register one with Snowflake and add the redirect URI you copied.

    Then enter the app's Client ID and Client Secret on the Snowflake connection.

    Console steps with screenshots

    Register your Scalekit environment with the Snowflake connector so Scalekit handles the authentication flow and token lifecycle for you. The connection name you create will be used to identify and invoke the connection programmatically. You’ll need to create an OAuth Security Integration in your Snowflake account.

    1. Set up auth redirects

      • In Scalekit dashboard, go to AgentKit > Connections > Create Connection.

      • Find Snowflake from the list of providers and click Create. Copy the redirect URI. It looks like https://<SCALEKIT_ENVIRONMENT_URL>/sso/v1/oauth/<CONNECTION_ID>/callback.

        Copy redirect URI from Scalekit dashboard

      • Log into your Snowflake account (Snowsight) and run the following SQL to create an OAuth Security Integration, replacing <redirect_uri> with the URI you copied:

        CREATE OR REPLACE SECURITY INTEGRATION scalekit_oauth
        TYPE = OAUTH
        OAUTH_CLIENT = CUSTOM
        OAUTH_CLIENT_TYPE = 'CONFIDENTIAL'
        OAUTH_REDIRECT_URI = '<redirect_uri>'
        ENABLED = TRUE;
    2. Get client credentials

      • After creating the integration, run the following SQL to retrieve the client credentials:

        SELECT SYSTEM$SHOW_OAUTH_CLIENT_SECRETS('SCALEKIT_OAUTH');
      • This returns a JSON object containing:

        • Client ID — value of OAUTH_CLIENT_ID
        • Client Secret — value of OAUTH_CLIENT_SECRET_2 (or OAUTH_CLIENT_SECRET_1)
    3. Add credentials in Scalekit

      • In Scalekit dashboard, go to AgentKit > Connections and open the connection you created.

      • Enter your credentials:

        • Client ID (from the SQL output)
        • Client Secret (from the SQL output)

        Add credentials in Scalekit dashboard

      • Click Save.

  5. Authorize a user and make your first call

    quickstart.mts
    import { ScalekitClient } from '@scalekit-sdk/node'
    import 'dotenv/config'
    import { createInterface } from 'node:readline/promises'
    const scalekit = new ScalekitClient(
    process.env.SCALEKIT_ENVIRONMENT_URL,
    process.env.SCALEKIT_CLIENT_ID,
    process.env.SCALEKIT_CLIENT_SECRET,
    )
    const actions = scalekit.actions
    const connector = 'snowflake'
    const identifier = 'user_123'
    // Generate an authorization link for the user
    const { link } = await actions.getAuthorizationLink({ connectionName: connector, identifier })
    console.log('Authorize Snowflake:', link)
    const rl = createInterface({ input: process.stdin, output: process.stdout })
    await rl.question('Press Enter after authorizing...')
    rl.close()
    // Make your first call
    const result = await actions.executeTool({
    connector,
    identifier,
    toolName: 'snowflake_show_primary_keys',
    toolInput: {},
    })
    console.log(result)
    Terminal window
    npx tsx quickstart.mts

    Each user signs in once. See Authorize a user for the full flow and statuses.

Tools

Pass the exact name to execute_tool
Try in PlaygroundRequest a tool
  • snowflake_get_columnsQuery INFORMATION_SCHEMA.COLUMNS for column metadata.Read-only

    Get Columns

    Query INFORMATION_SCHEMA.COLUMNS for column metadata.

    Inputs

    databasestringrequired
    Database name
    column_name_likestring
    Optional column name pattern
    limitinteger
    Maximum rows
    rolestring
    Optional role
    schemastring
    Optional schema filter
    tablestring
    Optional table filter
    warehousestring
    Optional warehouse
  • snowflake_get_query_partitionGet a specific result partition for a Snowflake SQL API statement.Read-only

    Get Query Partition

    Get a specific result partition for a Snowflake SQL API statement.

    Inputs

    partitionintegerrequired
    Partition index to fetch (0-based)
    statement_handlestringrequired
    Snowflake statement handle returned by Execute Query
    request_idstring
    Optional request ID used when the statement was submitted
  • snowflake_get_query_statusGet Snowflake SQL API statement status and first partition result metadata by statement handle.Read-only

    Get Query Status

    Get Snowflake SQL API statement status and first partition result metadata by statement handle.

    Inputs

    statement_handlestringrequired
    Snowflake statement handle returned by Execute Query
    request_idstring
    Optional request ID used when the statement was submitted
  • snowflake_get_referential_constraintsQuery INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS.Read-only

    Get Referential Constraints

    Query INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS.

    Inputs

    databasestringrequired
    Database name
    limitinteger
    Maximum rows
    rolestring
    Optional role
    schemastring
    Optional schema filter
    tablestring
    Optional table filter
    warehousestring
    Optional warehouse
  • snowflake_get_schemataQuery INFORMATION_SCHEMA.SCHEMATA for schema metadata.Read-only

    Get Schemata

    Query INFORMATION_SCHEMA.SCHEMATA for schema metadata.

    Inputs

    databasestringrequired
    Database name
    limitinteger
    Maximum rows
    rolestring
    Optional role
    schema_likestring
    Optional schema pattern
    warehousestring
    Optional warehouse
  • snowflake_get_table_constraintsQuery INFORMATION_SCHEMA.TABLE_CONSTRAINTS.Read-only

    Get Table Constraints

    Query INFORMATION_SCHEMA.TABLE_CONSTRAINTS.

    Inputs

    databasestringrequired
    Database name
    constraint_typestring
    Optional constraint type filter
    limitinteger
    Maximum rows
    rolestring
    Optional role
    schemastring
    Optional schema filter
    tablestring
    Optional table filter
    warehousestring
    Optional warehouse
  • snowflake_get_tablesQuery INFORMATION_SCHEMA.TABLES for table metadata in a Snowflake database.Read-only

    Get Tables

    Query INFORMATION_SCHEMA.TABLES for table metadata in a Snowflake database.

    Inputs

    databasestringrequired
    Database name
    limitinteger
    Maximum number of rows
    rolestring
    Optional role
    schemastring
    Optional schema filter
    table_name_likestring
    Optional table name pattern
    warehousestring
    Optional warehouse
  • snowflake_show_databases_schemasRun SHOW DATABASES or SHOW SCHEMAS.Read-only

    Show Databases / Schemas

    Run SHOW DATABASES or SHOW SCHEMAS.

    Inputs

    object_typestringrequired
    Object type to showone of databasesschemas
    database_namestring
    Optional database scope for SHOW SCHEMAS
    like_patternstring
    Optional LIKE pattern
    rolestring
    Optional role
    warehousestring
    Optional warehouse

Workflows

Don’t worry about your Snowflake account domain in the path. Scalekit automatically resolves {{domain}} from the connected account’s configuration. For example, a request with path="/api/v2/statements" will be sent to https://myorg-myaccount.snowflakecomputing.com/api/v2/statements automatically.

Proxy API call
const result = await actions.request({
connectionName: 'snowflake',
identifier: 'user_123',
path: '/api/v2/statements',
method: 'POST',
});
console.log(result);
Execute a tool
const result = await actions.executeTool({
connector: 'snowflake',
identifier: 'user_123',
toolName: 'snowflake_cancel_query',
toolInput: {},
});
console.log(result);