KosmoKrator

database

Snowflake CLI for AI Agents

Use the Snowflake CLI from KosmoKrator to call Snowflake tools headlessly, return JSON, inspect schemas, and automate workflows from coding agents, scripts, and CI.

9 functions 8 read 1 write Manual OAuth token auth

Snowflake CLI Setup

Snowflake can be configured headlessly with `kosmokrator integrations:configure snowflake`.

# Install KosmoKrator first if it is not available on PATH.
curl -fsSL https://raw.githubusercontent.com/OpenCompanyApp/kosmokrator/main/install.sh | bash

# Configure and verify this integration.
kosmokrator integrations:configure snowflake --set access_token="$SNOWFLAKE_ACCESS_TOKEN" --set account="$SNOWFLAKE_ACCOUNT" --enable --read allow --write ask --json
kosmokrator integrations:doctor snowflake --json
kosmokrator integrations:status --json

Credentials

Authentication type: Manual OAuth token oauth2_manual_token. Configure credentials once, then use the same stored profile from scripts, coding CLIs, Lua code mode, and the MCP gateway.

KeyEnv varTypeRequiredLabel
access_token SNOWFLAKE_ACCESS_TOKEN Secret secret yes Access Token
account SNOWFLAKE_ACCOUNT Text string yes Account Identifier

Call Snowflake Headlessly

Use the generic call form when another coding CLI or script needs a stable universal interface.

kosmo integrations:call snowflake.snowflake_execute_query '{
  "sql": "example_sql",
  "warehouse": "example_warehouse",
  "database": "example_database",
  "schema": "example_schema"
}' --json

Use the provider shortcut form for shorter human-facing commands.

kosmo integrations:snowflake snowflake_execute_query '{
  "sql": "example_sql",
  "warehouse": "example_warehouse",
  "database": "example_database",
  "schema": "example_schema"
}' --json

Agent Discovery Commands

These commands return structured output for coding agents that need to inspect capabilities before choosing a function.

kosmo integrations:docs snowflake --json
kosmo integrations:docs snowflake.snowflake_execute_query --json
kosmo integrations:schema snowflake.snowflake_execute_query --json
kosmo integrations:search "Snowflake" --json
kosmo integrations:list --json

All CLI Functions

Every function below can be called headlessly. The generic form is stable across all integrations; the provider shortcut is shorter but specific to Snowflake.

snowflake.snowflake_execute_query

Write write

Execute a SQL statement on Snowflake. Returns column metadata and result rows. Optionally specify warehouse, database, and schema context.

Parameters
sql, warehouse, database, schema

Generic CLI call

kosmo integrations:call snowflake.snowflake_execute_query '{"sql":"example_sql","warehouse":"example_warehouse","database":"example_database","schema":"example_schema"}' --json

Provider shortcut

kosmo integrations:snowflake snowflake_execute_query '{"sql":"example_sql","warehouse":"example_warehouse","database":"example_database","schema":"example_schema"}' --json

snowflake.snowflake_list_databases

Read read

List all databases in the Snowflake account. Returns database names, identifiers, and creation timestamps.

Parameters
none

Generic CLI call

kosmo integrations:call snowflake.snowflake_list_databases '{}' --json

Provider shortcut

kosmo integrations:snowflake snowflake_list_databases '{}' --json

snowflake.snowflake_get_database

Read read

Get details for a specific Snowflake database, including retention time, owner, and size.

Parameters
database

Generic CLI call

kosmo integrations:call snowflake.snowflake_get_database '{"database":"example_database"}' --json

Provider shortcut

kosmo integrations:snowflake snowflake_get_database '{"database":"example_database"}' --json

snowflake.snowflake_list_schemas

Read read

List all schemas within a Snowflake database. Returns schema names and metadata.

Parameters
database

Generic CLI call

kosmo integrations:call snowflake.snowflake_list_schemas '{"database":"example_database"}' --json

Provider shortcut

kosmo integrations:snowflake snowflake_list_schemas '{"database":"example_database"}' --json

snowflake.snowflake_list_tables

Read read

List all tables within a Snowflake database schema. Returns table names, types, and metadata.

Parameters
database, schema

Generic CLI call

kosmo integrations:call snowflake.snowflake_list_tables '{"database":"example_database","schema":"example_schema"}' --json

Provider shortcut

kosmo integrations:snowflake snowflake_list_tables '{"database":"example_database","schema":"example_schema"}' --json

snowflake.snowflake_describe_table

Read read

Describe a Snowflake table — get column names, data types, nullable, default values, and other metadata.

Parameters
database, schema, table

Generic CLI call

kosmo integrations:call snowflake.snowflake_describe_table '{"database":"example_database","schema":"example_schema","table":"example_table"}' --json

Provider shortcut

kosmo integrations:snowflake snowflake_describe_table '{"database":"example_database","schema":"example_schema","table":"example_table"}' --json

snowflake.snowflake_list_warehouses

Read read

List all warehouses in the Snowflake account. Returns warehouse names, sizes, and status.

Parameters
none

Generic CLI call

kosmo integrations:call snowflake.snowflake_list_warehouses '{}' --json

Provider shortcut

kosmo integrations:snowflake snowflake_list_warehouses '{}' --json

snowflake.snowflake_get_warehouse

Read read

Get details for a specific Snowflake warehouse, including size, type, auto-suspend, and auto-resume settings.

Parameters
name

Generic CLI call

kosmo integrations:call snowflake.snowflake_get_warehouse '{"name":"example_name"}' --json

Provider shortcut

kosmo integrations:snowflake snowflake_get_warehouse '{"name":"example_name"}' --json

snowflake.snowflake_get_current_user

Read read

Get the current authenticated Snowflake user and session information.

Parameters
none

Generic CLI call

kosmo integrations:call snowflake.snowflake_get_current_user '{}' --json

Provider shortcut

kosmo integrations:snowflake snowflake_get_current_user '{}' --json

Function Schemas

Use these parameter tables when building CLI payloads without calling integrations:schema first.

snowflake.snowflake_execute_query

Execute a SQL statement on Snowflake. Returns column metadata and result rows. Optionally specify warehouse, database, and schema context.

Operation
Write write
Schema command
kosmo integrations:schema snowflake.snowflake_execute_query --json
ParameterTypeRequiredDescription
sql string yes The SQL statement to execute (e.g., "SELECT * FROM my_table LIMIT 10").
warehouse string no The warehouse to use for the query (overrides default).
database string no The database context for the query.
schema string no The schema context for the query.

snowflake.snowflake_list_databases

List all databases in the Snowflake account. Returns database names, identifiers, and creation timestamps.

Operation
Read read
Schema command
kosmo integrations:schema snowflake.snowflake_list_databases --json
ParameterTypeRequiredDescription
No parameters.

snowflake.snowflake_get_database

Get details for a specific Snowflake database, including retention time, owner, and size.

Operation
Read read
Schema command
kosmo integrations:schema snowflake.snowflake_get_database --json
ParameterTypeRequiredDescription
database string yes The database name or identifier.

snowflake.snowflake_list_schemas

List all schemas within a Snowflake database. Returns schema names and metadata.

Operation
Read read
Schema command
kosmo integrations:schema snowflake.snowflake_list_schemas --json
ParameterTypeRequiredDescription
database string yes The database name to list schemas from.

snowflake.snowflake_list_tables

List all tables within a Snowflake database schema. Returns table names, types, and metadata.

Operation
Read read
Schema command
kosmo integrations:schema snowflake.snowflake_list_tables --json
ParameterTypeRequiredDescription
database string yes The database name.
schema string yes The schema name within the database.

snowflake.snowflake_describe_table

Describe a Snowflake table — get column names, data types, nullable, default values, and other metadata.

Operation
Read read
Schema command
kosmo integrations:schema snowflake.snowflake_describe_table --json
ParameterTypeRequiredDescription
database string yes The database name.
schema string yes The schema name.
table string yes The table name.

snowflake.snowflake_list_warehouses

List all warehouses in the Snowflake account. Returns warehouse names, sizes, and status.

Operation
Read read
Schema command
kosmo integrations:schema snowflake.snowflake_list_warehouses --json
ParameterTypeRequiredDescription
No parameters.

snowflake.snowflake_get_warehouse

Get details for a specific Snowflake warehouse, including size, type, auto-suspend, and auto-resume settings.

Operation
Read read
Schema command
kosmo integrations:schema snowflake.snowflake_get_warehouse --json
ParameterTypeRequiredDescription
name string yes The warehouse name.

snowflake.snowflake_get_current_user

Get the current authenticated Snowflake user and session information.

Operation
Read read
Schema command
kosmo integrations:schema snowflake.snowflake_get_current_user --json
ParameterTypeRequiredDescription
No parameters.

Permissions

Headless calls still follow the integration read/write permission policy. Configure read/write defaults with integrations:configure. Add --force only for trusted automation that should bypass that policy.