Skip to content
Scalekit Docs
Talk to an Engineer Dashboard

Connect AI agents to Grist

Scalekit connector
Open markdown

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

Tools
48
What they doRead · write · destructive
20 · 24 · 420 read24 write4 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 Grist connection

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

    Each user opens the link once and enters their Grist 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
  • grist_compare_docsCompare a document with another document, for example a fork against its original.Read-only

    Compare Documents

    Compare a document with another document, for example a fork against its original. Returns the left and right states, their common parent, and a summary of changes. Use fork_doc to create a fork to compare.

    Inputs

    doc_idstringrequired
    ID of the Grist document (a UUID-style string, also shown as the document's id in its URL or from Grist list workspaces results).
    doc_id2stringrequired
    ID of the second document to compare against.
    detailboolean
    Set to true to include detailed change information. Leave empty for a summary only.
    max_rowsinteger
    Maximum number of row changes to include in the detail. Leave empty for the server default.
  • grist_get_attachment_metadataGet the metadata of one attachment.Read-only

    Get Attachment Metadata

    Get the metadata of one attachment. Returns fileName, fileSize, and timeUploaded. Use list_attachments to find attachment IDs.

    Inputs

    attachment_idintegerrequired
    Numeric ID of the attachment.
    doc_idstringrequired
    ID of the Grist document (a UUID-style string, also shown as the document's id in its URL or from Grist list workspaces results).
  • grist_get_current_userGet the profile of the user the API key belongs to.Read-only

    Get Current User

    Get the profile of the user the API key belongs to. Returns the user's id, name, and picture. Use list_orgs to see what the user can access.

    Inputs

    This tool takes no inputs.

  • grist_get_docRetrieve a document's metadata: name, access level, pinned state, and its workspace.Read-only

    Get Document

    Retrieve a document's metadata: name, access level, pinned state, and its workspace. Returns id, name, access, isPinned, urlId, and the containing workspace and org. Use list_tables to see the document's contents.

    Inputs

    doc_idstringrequired
    ID of the Grist document (a UUID-style string, also shown as the document's id in its URL or from Grist list workspaces results).
  • grist_get_doc_statesGet a document's action history as a list of states, most recent first.Read-only

    Get Document States

    Get a document's action history as a list of states, most recent first. Returns a states array with a sequential number n and a hash h for each state. Use list_doc_snapshots for backups.

    Inputs

    doc_idstringrequired
    ID of the Grist document (a UUID-style string, also shown as the document's id in its URL or from Grist list workspaces results).
  • grist_get_orgRetrieve one organization (team site or personal area) by ID or subdomain.Read-only

    Get Org

    Retrieve one organization (team site or personal area) by ID or subdomain. Returns the org's id, name, domain, owner, access level, and created and updated timestamps. Use list_orgs to discover orgs. Use list_workspaces to see what is inside one.

    Inputs

    org_idstringrequired
    Organization (site) to use: its numeric ID, its subdomain such as acme, or the word current to use the site implied by the connected Grist host. Get IDs from the list orgs tool.
  • grist_get_org_usageGet usage statistics for all non-deleted documents in an organization.Read-only

    Get Org Usage

    Get usage statistics for all non-deleted documents in an organization. Returns document counts by data limit status and attachment storage totals. Only available to organization owners.

    Inputs

    org_idstringrequired
    Organization (site) to use: its numeric ID, its subdomain such as acme, or the word current to use the site implied by the connected Grist host. Get IDs from the list orgs tool.
  • grist_get_table_schemaGet a table's schema in the Frictionless Data table-schema format.Read-only

    Get Table Schema

    Get a table's schema in the Frictionless Data table-schema format. Returns a schema object describing each field's name and type. Use list_columns for Grist-native column metadata instead.

    Inputs

    doc_idstringrequired
    ID of the Grist document (a UUID-style string, also shown as the document's id in its URL or from Grist list workspaces results).
    table_idstringrequired
    Normalized name of the table, as shown as TABLE ID in Raw Data.
    headerstring
    Header format: colId for normalized column IDs or label for human-friendly labels. Leave empty for the server default.one of colIdlabel