Skip to content
Scalekit Docs
Talk to an Engineer Dashboard

Connect AI agents to Butterbase

Scalekit connector
Open markdown

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

Tools
210
What they doRead · write · destructive
94 · 94 · 2294 read94 write22 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 Butterbase connection

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

    Console steps with screenshots

    Register your Butterbase API key with Scalekit so it can authenticate requests to Butterbase on behalf of your users. Butterbase uses API key authentication with an account-scoped key.

    1. Generate a Butterbase API key

      • Sign in to the Butterbase dashboard and open API keys in the left sidebar.

      • Click Generate key.

        Butterbase API keys page with the Generate key button

      • Enter a Name for the key, such as Scalekit.

        New API key dialog with the Name field

      • Expand Advanced and set Key scope to Account. Account scope works across all your apps.

      • Under Additional scopes, keep ai:gateway and substrate checked.

        Advanced section with Account key scope and the ai and substrate scopes checked

      • Click Generate.

      Butterbase shows the new key once, and the API keys table lists it with its prefix and scopes

    2. Create a connection in Scalekit

      • In the Scalekit dashboard, go to AgentKit → Connections → Create Connection.
      • Search for Butterbase and click Create.
      • Note the Connection name — use this as connection_name in your code (e.g., butterbase).
    3. Add a connected account

      Connected accounts link a specific user identifier in your system to a Butterbase API key. Add one in the dashboard to test. In production, each user adds their own through the authorization link: they enter their credentials on the page it opens.

      In the dashboard, to test

      • Open the connection and click the Connected Accounts tab → Add account.
      • Fill in Your User’s ID and API Key, then click Save.

      From your backend, if your app already has the credentials

      For example, when users enter them on a settings page in your app:

      import { ConnectorStatus } from '@scalekit-sdk/node'
      const authorizationDetails = {
      details: {
      case: 'staticAuth',
      value: { details: { token: 'bb_sk_...' } },
      },
      };
      let { connectedAccount } = await scalekit.actions.upsertConnectedAccount({
      connectionName: 'butterbase',
      identifier: 'user_123',
      authorizationDetails,
      });
      // Make sure the account is ACTIVE before the first tool call.
      if (connectedAccount?.status !== ConnectorStatus.ACTIVE) {
      ({ connectedAccount } = await scalekit.actions.upsertConnectedAccount({
      connectionName: 'butterbase',
      identifier: 'user_123',
      authorizationDetails,
      }));
      }
  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 = 'butterbase'
    const identifier = 'user_123'
    // Generate an authorization link for the user
    const { link } = await actions.getAuthorizationLink({ connectionName: connector, identifier })
    console.log('Authorize Butterbase:', 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: 'butterbase_apps_list',
    toolInput: {},
    })
    console.log(result)
    Terminal window
    npx tsx quickstart.mts

    Each user opens the link once and enters their Butterbase credentials there. If your app already has a user's credentials, add the account from your backend instead, as the console steps above show. See Authorize a user for the full flow and statuses.

Tools

Pass the exact name to execute_tool
Try in PlaygroundRequest a tool
  • butterbase_agent_getGet a single Butterbase agent's full configuration by name, including its model, graph_spec, visibility, and run limits.Read-only

    Get Agent

    Get a single Butterbase agent's full configuration by name, including its model, graph_spec, visibility, and run limits. Returns the agent object as Butterbase stores it. Use butterbase_agent_get to inspect one specific agent. Use butterbase_agents_list to browse every agent in the app.

    Inputs

    app_idstringrequired
    The Butterbase app's unique ID the agent belongs to.
    namestringrequired
    The unique name of the agent to fetch, as given when it was created (or seen in a prior butterbase_agents_list response).
  • butterbase_agent_run_events_listFetch every event recorded for an agent run as a single JSON array, instead of connecting to the run's live event stream.Read-only

    List Agent Run Events

    Fetch every event recorded for an agent run as a single JSON array, instead of connecting to the run's live event stream. Returns an array of event objects covering the run's lifecycle — run_start, node_start, node_end, tool_call_start, tool_call_end, llm_token_usage, run_paused, run_cancelled, run_failed, and run_end. Use butterbase_agent_run_events_list to review a run's full event history at any point after it starts. Use butterbase_agent_run_get instead for just the run's current summary state.

    Inputs

    app_idstringrequired
    The id of the Butterbase app the agent belongs to.
    idstringrequired
    The id of the run whose events you want to fetch.
    namestringrequired
    The unique name of the agent whose run's events you want to fetch.
  • butterbase_agent_run_getGet a single agent run's full state by id.Read-only

    Get Agent Run

    Get a single agent run's full state by id. Returns the run object, including its status and, once available, its output. Use butterbase_agent_run_get to inspect or poll one specific run. Use butterbase_agent_runs_list to find its id first.

    Inputs

    app_idstringrequired
    The Butterbase app's unique ID the agent belongs to.
    namestringrequired
    The unique name of the agent the run belongs to.
    run_idstringrequired
    The id of the run to fetch, as returned by butterbase_agent_run_create or a prior butterbase_agent_runs_list call.
  • butterbase_agent_runs_listList an agent's recent runs.Read-only

    List Agent Runs

    List an agent's recent runs. Returns an array of run objects with each run's id and status; Butterbase's docs don't itemize further response fields or pagination parameters for this endpoint. Use butterbase_agent_runs_list to see recent activity for one agent. Use butterbase_agent_run_get to fetch one run's full state.

    Inputs

    app_idstringrequired
    The Butterbase app's unique ID the agent belongs to.
    namestringrequired
    The unique name of the agent whose runs to list.
  • butterbase_agent_validateValidate a candidate graph_spec for an existing Butterbase agent without saving it.Read-only

    Validate Agent Graph

    Validate a candidate graph_spec for an existing Butterbase agent without saving it. Returns whether the graph is valid, plus a list of issues (each with a path and message) when it isn't. Use butterbase_agent_validate to check a new or edited graph before committing it with butterbase_agent_create or butterbase_agent_update.

    Inputs

    app_idstringrequired
    The Butterbase app's unique ID the agent belongs to.
    graph_specobjectrequired
    The agent's tool-calling graph specification. FULLY CONFIRMED live via butterbase_agent_validate and an end-to-end agent run (Butterbase's docs previously described a different, incorrect shape). The object requires: spec_version (string, e.g. "1"), entry (the starting node id), nodes (an OBJECT keyed by node id — each llm node needs type:"llm", model, system_prompt, input_template, and output_key (the state key its output is written to); each end node needs type:"end" and output_template), edges (a top-level ARRAY of {"from": "<node_id>", "to": "<node_id>"} objects connecting the nodes — node linking is NOT a per-node field), tools (object: {"builtin": [], "mcp_servers": [], "functions": []}), and limits (object with 5 required numeric fields: max_steps, max_tool_calls, max_parallel_tools, timeout_seconds, human_timeout_seconds). Node prompts and templates can reference shared run state via {{ state.key }} templating. Example (validated live, ran to completion): {"spec_version": "1", "entry": "start", "nodes": {"start": {"type": "llm", "model": "anthropic/claude-haiku-4-5", "system_prompt": "You are a helpful assistant.", "input_template": "{{ state.user_question }}", "output_key": "answer"}, "done": {"type": "end", "output_template": "{{ state.answer }}"}}, "edges": [{"from": "start", "to": "done"}], "tools": {"builtin": [], "mcp_servers": [], "functions": []}, "limits": {"max_steps": 10, "max_tool_calls": 10, "max_parallel_tools": 1, "timeout_seconds": 60, "human_timeout_seconds": 3600}} ADDITIONAL CONFIRMED FACTS (from a dedicated live investigation): graph_spec.nodes[id].type actually has THREE valid values, not two -- "llm", "tool", and "end" (confirmed via agent_validate's own invalid_union_discriminator error). A "tool" node calls exactly one tool deterministically as its own graph step (distinct from an "llm" node, where the model decides whether/when to call from its available tools list); it needs {"type": "tool", "tool_ref": <tool reference, see below>, "args_template": <object, may use {{ state.* }} templating>, "output_key": "<string>"}. Separately: an "llm" node's per-node "tools" array entries, and a "tool" node's "tool_ref", are NOT plain strings -- they are a discriminated union keyed by "source": {"source": "builtin", "name": "<string>"} for a builtin tool (confirmed real names: delete_row, update_row -- validate does not check tool-name existence, only the runtime does, failing fast with a clean "unknown builtin tool" error if wrong), {"source": "mcp", "server_id": "<string>", "name": "<string>"} for an MCP tool, or {"source": "function", "name": "<string>"} for a Butterbase function. This is a completely separate shape from the top-level graph_spec.tools.{builtin, mcp_servers, functions} registration object, which remains flat string arrays as originally documented -- that object registers what the agent may use overall, while each node's own tools/tool_ref field is where a specific tool is actually referenced and invoked. Confirmed end-to-end: a "tool" node targeting {"source": "builtin", "name": "delete_row"} successfully deleted a real row and produced a full run_start -> node_start -> tool_call_start -> tool_call_end -> node_end -> run_end event trace.
    namestringrequired
    The unique name of the agent to validate the graph against.
  • butterbase_agents_listList all agents defined in a Butterbase app.Read-only

    List Agents

    List all agents defined in a Butterbase app. Returns an array of agent objects, each with the agent's name, display name, description, default model, visibility, and run/budget limits. Use butterbase_agents_list to see which agents exist in an app before starting or configuring a run against one of them.

    Inputs

    app_idstringrequired
    The Butterbase app ID whose agents you want to list. Found in the app's dashboard URL or via Butterbase's apps listing.
  • butterbase_ai_config_getGet an app's AI gateway configuration in Butterbase.Read-only

    Get AI Config

    Get an app's AI gateway configuration in Butterbase. Returns a config object with the app's default model, its maximum tokens allowed per request, and its list of allowed models. Use butterbase_ai_config_get to check an app's current AI settings before calling butterbase_ai_config_update to change them.

    Inputs

    app_idstringrequired
    The id of the Butterbase app whose AI configuration to fetch.
  • butterbase_ai_models_listList the AI models available and allowed for use by one Butterbase app.Read-only

    List AI Models

    List the AI models available and allowed for use by one Butterbase app. Returns a JSON array of model objects (exact fields are not published in Butterbase's docs). Use butterbase_ai_models_list to see which model identifiers are valid before calling butterbase_chat_completions_create or butterbase_embeddings_create.

    Inputs

    app_idstringrequired
    The Butterbase app ID whose allowed AI models to list.