Skip to content
Scalekit Docs
Talk to an Engineer Dashboard

Connect AI agents to dbt

Scalekit connector
Open markdown

The dbt connector lets your AI agent act in each user's dbt account. Each user connects their own dbt access token once, and Scalekit sends it with every call, so your agent never handles credentials. It comes with 22 tools.

Tools
22
What they doRead · write · destructive
17 · 3 · 217 read3 write2 destructive
Users sign in with

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 dbt connection

    In AgentKit > Connections, create a dbt 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 = 'dbtcloud'
    const identifier = 'user_123'
    // Generate an authorization link for the user
    const { link } = await actions.getAuthorizationLink({ connectionName: connector, identifier })
    console.log('Authorize dbt:', 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: 'dbtcloud_accounts_list',
    toolInput: {},
    })
    console.log(result)
    Terminal window
    npx tsx quickstart.mts

    Each user opens the link once and enters their dbt 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
  • dbtcloud_account_getGet one dbt account by ID.Read-only

    Get Account

    Get one dbt account by ID. Returns its name, plan, state, run_slots, developer seat counts and settings. Use this to check an account's plan and limits. Use dbtcloud_accounts_list to find account IDs.

    Inputs

    account_idintegerrequired
    Your dbt account ID: the number after /accounts/ in your dbt URL, or from dbtcloud_accounts_list. Example: 12345
  • dbtcloud_accounts_listList the dbt accounts the token can access.Read-only

    List Accounts

    List the dbt accounts the token can access. Returns each account's id, name, plan, state and run_slots. Use this to find the account_id every other dbt tool needs.

    Inputs

    This tool takes no inputs.

  • dbtcloud_environment_getGet one dbt environment by ID.Read-only

    Get Environment

    Get one dbt environment by ID. Returns its name, type, deployment_type, dbt_version, custom_branch and credentials reference. Use this when you know the environment_id. Use dbtcloud_environments_list to browse.

    Inputs

    account_idintegerrequired
    Your dbt account ID: the number after /accounts/ in your dbt URL, or from dbtcloud_accounts_list. Example: 12345
    environment_idintegerrequired
    ID of the environment. Example: 218762
    project_idintegerrequired
    ID of the dbt project. Get it from dbtcloud_projects_list. Example: 270542
  • dbtcloud_environment_variables_listList the environment variables of a dbt project with their value in each environment.Read-only

    List Environment Variables

    List the environment variables of a dbt project with their value in each environment. Returns each variable name with its project default and per-environment values; secret values are masked. Use this to see how a project is configured across environments.

    Inputs

    account_idintegerrequired
    Your dbt account ID: the number after /accounts/ in your dbt URL, or from dbtcloud_accounts_list. Example: 12345
    project_idintegerrequired
    ID of the dbt project. Get it from dbtcloud_projects_list. Example: 270542
  • dbtcloud_environments_listList the environments of a dbt project.Read-only

    List Environments

    List the environments of a dbt project. Returns each environment's id, name, type (development or deployment), deployment_type (production or staging), dbt_version and custom_branch. Use this to find an environment_id for filtering jobs and runs.

    Inputs

    account_idintegerrequired
    Your dbt account ID: the number after /accounts/ in your dbt URL, or from dbtcloud_accounts_list. Example: 12345
    project_idintegerrequired
    ID of the dbt project. Get it from dbtcloud_projects_list. Example: 270542
    deployment_typestring
    Only environments of this deployment type: production or staging. Example: productionone of productionstaging
    limitinteger
    Maximum number of environments to return, up to 100. Example: 25
    offsetinteger
    Number of environments to skip, for paging. Example: 25
  • dbtcloud_job_getGet one dbt job by ID.Read-only

    Get Job

    Get one dbt job by ID. Returns its name, environment, execute_steps (dbt commands), triggers, schedule, settings and the most recent runs when requested. Use this to inspect a job before running it.

    Inputs

    account_idintegerrequired
    Your dbt account ID: the number after /accounts/ in your dbt URL, or from dbtcloud_accounts_list. Example: 12345
    job_idintegerrequired
    ID of the job. Get it from dbtcloud_jobs_list. Example: 43167
    include_relatedstring
    Related objects to include, comma-separated: most_recent_run, most_recent_completed_run. Example: most_recent_run
  • dbtcloud_jobs_listList the jobs in a dbt account, optionally for one project or environment.Read-only

    List Jobs

    List the jobs in a dbt account, optionally for one project or environment. Returns each job's id, name, project_id, environment_id, execute_steps, triggers, schedule and state. Use this to find a job_id before dbtcloud_job_run. Use dbtcloud_job_get for one job.

    Inputs

    account_idintegerrequired
    Your dbt account ID: the number after /accounts/ in your dbt URL, or from dbtcloud_accounts_list. Example: 12345
    environment_idinteger
    Only jobs in this environment. Example: 218762
    limitinteger
    Maximum number of jobs to return, up to 100. Example: 25
    name_containsstring
    Only jobs whose name contains this text (case-insensitive). Example: nightly
    offsetinteger
    Number of jobs to skip, for paging. Example: 25
    order_bystring
    Field to sort by; prefix with - for descending. Example: -id
    project_idinteger
    Only jobs in this project. Example: 270542
  • dbtcloud_project_getGet one dbt project by ID.Read-only

    Get Project

    Get one dbt project by ID. Returns its name, description, connection, repository, environments and dbt_project_subdirectory. Use this when you know the project_id. Use dbtcloud_projects_list to browse.

    Inputs

    account_idintegerrequired
    Your dbt account ID: the number after /accounts/ in your dbt URL, or from dbtcloud_accounts_list. Example: 12345
    project_idintegerrequired
    ID of the dbt project. Get it from dbtcloud_projects_list. Example: 270542