Skip to content
Scalekit Docs
Talk to an Engineer Dashboard

Connect AI agents to Snowflake Key Pair Auth

Scalekit connector
Open markdown

The Snowflake Key Pair Auth connector lets your AI agent act in each user's Snowflake Key Pair Auth account. Each user connects their own Snowflake Key Pair Auth access token once, and Scalekit sends it with every call, 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

What you can do

  • Run SQL queries: execute SQL statements, check their status, fetch result partitions, and cancel running queries
  • Explore schemas: list databases, schemas, tables, and columns, and inspect primary keys and constraints
  • Manage databases and tables: create, alter, clone, drop, and restore databases, schemas, and tables
  • Control warehouses: create, alter, rename, suspend, resume, and drop virtual warehouses
  • Manage users and roles: create and drop users and roles, grant or revoke roles and privileges, and review grants

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 Key Pair Auth connection

    In AgentKit > Connections, create a Snowflake Key Pair Auth connection. The name you give it is the connection_name your code passes. See Configure connections.

  4. 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 = 'snowflakekeyauth'
    const identifier = 'user_123'
    // Generate an authorization link for the user
    const { link } = await actions.getAuthorizationLink({ connectionName: connector, identifier })
    console.log('Authorize Snowflake Key Pair Auth:', 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: 'snowflakekeyauth_show_primary_keys',
    toolInput: {},
    })
    console.log(result)
    Terminal window
    npx tsx quickstart.mts

    Each user opens the link once and enters their Snowflake credentials there. See Authorize a user for the full flow and statuses.

Tools

Pass the exact name to execute_tool
Try in PlaygroundRequest a tool
  • snowflakekeyauth_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
  • snowflakekeyauth_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
  • snowflakekeyauth_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
  • snowflakekeyauth_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
  • snowflakekeyauth_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
  • snowflakekeyauth_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
  • snowflakekeyauth_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
  • snowflakekeyauth_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: 'snowflakekeyauth',
identifier: 'user_123',
path: '/api/v2/statements',
method: 'POST',
body: { statement: 'SELECT CURRENT_USER()', timeout: 60 },
});
console.log(result);
Execute a tool
const result = await actions.executeTool({
connector: 'snowflakekeyauth',
identifier: 'user_123',
toolName: 'snowflakekeyauth_cancel_query',
toolInput: {},
});
console.log(result);