# AutessaDB

Source: https://docs.autessa.com/docs/tools/autessadb

> Tool types for inserting, updating, deleting, querying, and semantically searching AutessaDB tables, browsing and searching Drives, and querying columnar tables with SQL.

# AutessaDB

The read/write surface between agents and your data: insert and update rows, filter and delete with structured conditions, run vector search over any column, browse and search the files in a Drive, and answer questions from columnar tables with SQL.

No connector is required — every tool takes a `tableId` identifying one of your [AutessaDB tables](/docs/guide/autessadb/tables.md). Writes go through the same pipeline as user edits, so table triggers fire and computed columns recompute. The write tools take a `values` map of column name to a typed value object — set the slot matching the column type (`textValue`, `integerValue`, `floatValue`, `booleanValue`, `multiSelectValue`, or `filePath` for file-type columns). On read paths, file-type columns come back with short-lived download links in `presignedUrl`.

The filter-based tools share one condition format, the same one used by the [poweruser query API](/docs/api/poweruser/autessadb-query.md): `whereGroups` is a list of groups, each with a `logicalOperator` (`AND`/`OR`) combining its `conditions` (`columnName`, `operator`, `value`), and `groupsLogicalOperator` combines the groups. Operators include `EQUALS`, `NOT_EQUALS`, `GREATER_THAN`, `LESS_THAN`, `LIKE`, `ILIKE`, `CONTAINS`, `STARTS_WITH`, `ENDS_WITH`, `IN`, `NOT_IN`, `BETWEEN`, `IS_NULL`, and `IS_NOT_NULL`.

## Insert Row **TOOL** `AUTESSADB_INSERT`

Inserts one row into the table with the given column values. Triggers on the table are queued and computed columns are calculated asynchronously, exactly as if the row had been created in the UI.

The result is `{"insertedId": ..., "computationStatus": ..., "newRow": {...}}` with the full inserted row.

### Example

```json title="Tool config"
{
  "toolType": "AUTESSADB_INSERT",
  "tableId": "V1StGXR8Z5",
  "values": {
    "customer_name": { "textValue": "@@{CUSTOMER_NAME}" },
    "priority": { "integerValue": 2 },
    "status": { "textValue": "OPEN" }
  }
}
```

**Configuration fields**

- `tableId` (string (ID)) — Required string (ID) value. References an AutessaDB table by ID.
- `values` (object) — Required object value.

## Update Row **TOOL** `AUTESSADB_UPDATE`

Updates a single row identified by `rowId`, changing only the columns present in `values` — other columns are untouched. Table triggers fire and computed columns recompute after the update.

The result is `{"updatedId": ..., "computationStatus": ..., "oldRow": {...}, "newRow": {...}}`, so the agent can see exactly what changed.

### Example

```json title="Tool config"
{
  "toolType": "AUTESSADB_UPDATE",
  "tableId": "V1StGXR8Z5",
  "rowId": "@@{ROW_ID}",
  "values": {
    "status": { "textValue": "RESOLVED" },
    "resolution_notes": { "textValue": "@@{RESOLUTION_NOTES}" }
  }
}
```

**Configuration fields**

- `tableId` (string (ID)) — Required string (ID) value. References an AutessaDB table by ID.
- `rowId` (integer) — Required integer value.
- `values` (object) — Required object value.
- `deleteOrphanedFiles` (boolean) — Opt-in: when true, a FILE/IMAGE/AUDIO/VIDEO cell whose stored S3 URI is REPLACED or NULLED by this update has its prior S3 object deleted AFTER the transaction commits (best-effort; a delete failure is logged, never fails the write). Default false = fully backward compatible.

## Delete Rows **TOOL** `AUTESSADB_DELETE`

Batch-deletes every row matching `whereGroups`. `groupsLogicalOperator` defaults to `OR`, so with multiple groups a row matching any group is deleted — set it to `AND` explicitly when you mean an intersection. A deletion that would exceed the platform's batch-size cap is rolled back entirely, and `dryRun: true` skips the delete (it currently returns a placeholder message rather than a matching-row count, so preview counts with [Query Table](#query-table-) instead).

The result is `{"tableId": ..., "deletedCount": ..., "deletedRows": [...]}`.

### Example

```json title="Tool config"
{
  "toolType": "AUTESSADB_DELETE",
  "tableId": "V1StGXR8Z5",
  "whereGroups": [
    {
      "logicalOperator": "AND",
      "conditions": [
        { "columnName": "status", "operator": "EQUALS", "value": "ARCHIVED" },
        { "columnName": "created_at", "operator": "LESS_THAN", "value": "@@{CUTOFF_DATE}" }
      ]
    }
  ],
  "groupsLogicalOperator": "AND",
  "dryRun": false
}
```

**Configuration fields**

- `tableId` (string (ID)) — Required string (ID) value. References an AutessaDB table by ID.
- `whereGroups` (array<object>) — Required array<object> value.
- `groupsLogicalOperator` (string) — "AND" or "OR" — how to combine multiple whereGroups. Defaults to "OR".
- `dryRun` (boolean) — When true, returns the matching row count but does not delete. Defaults to false.

## Bulk Insert **TOOL** `AUTESSADB_BULK_INSERT`

Inserts many rows into the table in a single call. `rows` is a list of value maps, each the same shape as an `AUTESSADB_INSERT` `values`. Unlike single-row insert, **table triggers are suppressed by default** — bulk loads are usually ingestion where firing per-row triggers is rarely intended. Set `triggerMode` to `PER_ROW` or `BATCH_CONTEXT` to opt in. `atomicity` is `ALL_OR_NOTHING` (default; the whole call is one transaction) or `BEST_EFFORT_PER_CHUNK` (partial progress allowed). `indexingMode` and `computeMode` (`IMMEDIATE`/`DEFERRED`/`SKIP`) control when indexing and computed columns run. The row count per call is capped.

The result is `{"insertedCount": ..., "computationStatus": ..., "results": [{ "inputIndex": ..., "insertedId": ..., "errors": [...] }, ...]}`.

### Example

```json title="Tool config"
{
  "toolType": "AUTESSADB_BULK_INSERT",
  "tableId": "V1StGXR8Z5",
  "rows": [
    { "name": { "textValue": "Ada" } },
    { "name": { "textValue": "Grace" } }
  ],
  "atomicity": "ALL_OR_NOTHING"
}
```

**Configuration fields**

- `tableId` (string (ID)) — Required string (ID) value. References an AutessaDB table by ID.
- `rows` (array<object>) — Required array<object> value.
- `atomicity` (string (enum)) — Required string (enum) value.
- `indexingMode` (string (enum)) — Required string (enum) value.
- `computeMode` (string (enum)) — Required string (enum) value.
- `triggerMode` (string (enum)) — Required string (enum) value.

## Bulk Update **TOOL** `AUTESSADB_BULK_UPDATE`

Updates many rows by id in a single call. `updates` is a list of `{ "id": ..., "values": {...} }`, where each `values` is a partial patch (only the supplied columns change). Same mode fields and defaults as Bulk Insert (triggers suppressed by default).

The result is `{"updatedCount": ..., "computationStatus": ..., "results": [{ "inputIndex": ..., "updatedId": ..., "errors": [...] }, ...]}`.

### Example

```json title="Tool config"
{
  "toolType": "AUTESSADB_BULK_UPDATE",
  "tableId": "V1StGXR8Z5",
  "updates": [
    { "id": "@@{ROW_ID_1}", "values": { "status": { "textValue": "RESOLVED" } } },
    { "id": "@@{ROW_ID_2}", "values": { "status": { "textValue": "OPEN" } } }
  ]
}
```

**Configuration fields**

- `tableId` (string (ID)) — Required string (ID) value. References an AutessaDB table by ID.
- `updates` (array<object>) — Required array<object> value.
- `atomicity` (string (enum)) — Required string (enum) value.
- `indexingMode` (string (enum)) — Required string (enum) value.
- `computeMode` (string (enum)) — Required string (enum) value.
- `triggerMode` (string (enum)) — Required string (enum) value.
- `deleteOrphanedFiles` (boolean) — Opt-in: when true, any FILE/IMAGE/AUDIO/VIDEO cell whose stored S3 URI is REPLACED or NULLED by this bulk update has its prior S3 object deleted AFTER commit (best-effort; a delete failure is logged, never fails the write). Default false = fully backward compatible.

## Bulk Delete **TOOL** `AUTESSADB_BULK_DELETE`

Deletes many rows by id in a single call. `ids` is the list of row ids to remove. Only `atomicity` and `triggerMode` apply (nothing to index or compute on a delete); triggers are suppressed by default.

The result is `{"deletedCount": ..., "results": [{ "inputIndex": ..., "deletedId": ..., "errors": [...] }, ...]}`.

### Example

```json title="Tool config"
{
  "toolType": "AUTESSADB_BULK_DELETE",
  "tableId": "V1StGXR8Z5",
  "ids": [12345, 12346, 12347]
}
```

**Configuration fields**

- `tableId` (string (ID)) — Required string (ID) value. References an AutessaDB table by ID.
- `ids` (array<integer>) — Required array<integer> value.
- `atomicity` (string (enum)) — Required string (enum) value.
- `triggerMode` (string (enum)) — Required string (enum) value.

## Query Table **TOOL** `AUTESSADB_QUERY_TABLE`

Runs a structured, filtered query over the table and returns matching rows with pagination. `pageSize` defaults to 50 and is silently capped at 100; leave `whereGroups` empty to page through the whole table. File-type columns in the results carry short-lived download links.

Add `orderBy` to control sort order — a list of `{ "columnName": ..., "direction": "ASC" | "DESC" }` terms in priority order. For large tables, use seek pagination instead of `page`: pass the prior result's `nextCursor` back as `cursor` (reusing the same `orderBy`), and set `includeTotal` to `true` only when you actually need the total count.

The result is `{"rows": [...], "totalCount": ..., "currentPage": ..., "totalPages": ..., "nextCursor": ..., "hasMore": ..., "schema": {...}}` — the schema lets the agent interpret column types without a separate lookup, and `nextCursor`/`hasMore` drive cursor pagination.

### Example

```json title="Tool config"
{
  "toolType": "AUTESSADB_QUERY_TABLE",
  "tableId": "V1StGXR8Z5",
  "whereGroups": [
    {
      "logicalOperator": "OR",
      "conditions": [
        { "columnName": "assignee", "operator": "EQUALS", "value": "@@{ASSIGNEE}" },
        { "columnName": "assignee", "operator": "IS_NULL", "value": "" }
      ]
    }
  ],
  "groupsLogicalOperator": "AND",
  "orderBy": [{ "columnName": "created_at", "direction": "DESC" }],
  "pageSize": 50
}
```

**Configuration fields**

- `tableId` (string (ID)) — Required string (ID) value. References an AutessaDB table by ID.
- `whereGroups` (array<object>) — Required array<object> value.
- `groupsLogicalOperator` (string) — Required string value.
- `orderBy` (array<object>) — Required array<object> value.
- `page` (integer) — Required integer value.
- `pageSize` (integer) — Required integer value.
- `cursor` (string) — Required string value.
- `includeTotal` (boolean) — Required boolean value.
- `includeFileUrls` (boolean) — Required boolean value.

## Aggregate **TOOL** `AUTESSADB_AGGREGATE`

Runs a grouped aggregation over the table: filter with `whereGroups`, group by up to a few columns (`groupBy`), and compute `aggregates` (`COUNT`/`SUM`/`AVG`/`MIN`/`MAX`, each under a unique `alias`). Optionally filter groups with `having` (referencing aliases), sort with `orderBy`, and cap the result with `limit`. Columns hidden from the acting identity are treated as not existing, and columns visible only in masked form cannot be grouped or aggregated.

The result is `{"groups": [{ "key": {...}, "values": {...} }, ...]}` — one entry per group, with the grouping key and each alias's numeric value.

### Example

```json title="Tool config"
{
  "toolType": "AUTESSADB_AGGREGATE",
  "tableId": "V1StGXR8Z5",
  "groupBy": ["status"],
  "aggregates": [
    { "function": "COUNT", "alias": "count" },
    { "function": "AVG", "column": "age", "alias": "avg_age" }
  ],
  "orderBy": [{ "columnName": "count", "direction": "DESC" }]
}
```

**Configuration fields**

- `tableId` (string (ID)) — Required string (ID) value. References an AutessaDB table by ID.
- `whereGroups` (array<object>) — Required array<object> value.
- `groupsLogicalOperator` (string) — Required string value.
- `groupBy` (array<string>) — Required array<string> value.
- `aggregates` (array<object>) — Required array<object> value.
- `having` (array<object>) — Required array<object> value.
- `orderBy` (array<object>) — Required array<object> value.
- `limit` (integer) — Required integer value.

## Semantic Query **TOOL** `AUTESSADB_SEMANTIC_QUERY`

Runs vector-embedding search over one column (`columnName`) of the table and returns scored matches as structured JSON — the tool for RAG-style retrieval where the agent needs scores, pagination, and row details. `limit` defaults to 10 (max 100) and `scoreThreshold` (0–1) defaults to 0, so by default you get the top matches regardless of similarity. Semantic searches are rate-limited per company.

The result is `{"results": [...], "totalResults": ..., "currentPage": ..., "totalPages": ..., "metadata": {...}, "schema": {...}}`.

### Example

```json title="Tool config"
{
  "toolType": "AUTESSADB_SEMANTIC_QUERY",
  "tableId": "V1StGXR8Z5",
  "query": "@@{SEARCH_QUERY}",
  "columnName": "document_text",
  "limit": 10,
  "scoreThreshold": 0.5,
  "page": 1,
  "includeDetails": true
}
```

**Configuration fields**

- `tableId` (string (ID)) — Required string (ID) value. References an AutessaDB table by ID.
- `query` (string) — Required string value.
- `columnName` (string) — Required string value.
- `limit` (integer) — Required integer value.
- `scoreThreshold` (number) — Required number value.
- `page` (integer) — Required integer value.
- `includeDetails` (boolean) — Required boolean value.
- `includeFileUrls` (boolean) — Required boolean value.

## General Search **TOOL** `AUTESSADB_GENERAL_SEARCH`

The same vector search as [Semantic Query](#semantic-query-), packaged for direct reading: results come back as a readable markdown string (`## MATCH #1 (score: 0.84, recordId: ...)` followed by the content) instead of JSON. Defaults are tuned for precision — `topK` defaults to 5 and `scoreThreshold` to 0.7 — and there is no pagination. For file, image, and video columns it returns the content of the column's auto-generated notes companion rather than the raw file.

Prefer this type when the agent just needs to read what matched; prefer Semantic Query when downstream steps need structured fields.

### Example

```json title="Tool config"
{
  "toolType": "AUTESSADB_GENERAL_SEARCH",
  "tableId": "V1StGXR8Z5",
  "query": "@@{SEARCH_QUERY}",
  "columnName": "meeting_transcript",
  "topK": 5,
  "scoreThreshold": 0.7
}
```

**Configuration fields**

- `tableId` (string (ID)) — Required string (ID) value. References an AutessaDB table by ID.
- `query` (string) — Required string value.
- `columnName` (string) — Required string value.
- `topK` (integer) — Required integer value.
- `scoreThreshold` (number) — Required number value.
- `includeFileUrls` (boolean) — Required boolean value.

## Drive

**TOOL** `AUTESSADB_DRIVE`

Gives an agent access to an [AutessaDB Drive](/docs/guide/autessadb/drive.md): browse folders, find files, grep exact text, read pages and lines, run ranked search (meaning-based when the Drive's semantic search is on), look at files, and write text files. `tableId` must be a Drive. `op` picks the operation:

| `op` | What it does | Main arguments |
| --- | --- | --- |
| `ls` | List a folder's contents, folders first | `path`, `limit`, `cursor` |
| `tree` | Outline a folder and its subfolders | `path`, `maxDepth`, `maxEntries` |
| `find` | Find files by name, glob, type, date, or size | `path`, `glob`, `nameRegex`, `type`, `modifiedAfter` |
| `stat` | Details of one file: size, version, page count, processing status | `path` |
| `grep` | Lines containing an exact string or matching a regular expression | `pattern`, `regex`, `caseInsensitive`, `path`, `glob`, `context` |
| `read` | Text of a page range or line range | `path`, `pages` or `lines`, `maxChars` |
| `search` | Ranked keyword search; meaning-based when semantic search is enabled | `query`, `mode`, `path`, `topK` |
| `fetch` | A 10-minute download link; with `view: true`, the image or PDF pages are shown to the model | `path`, `view`, `pages` (at most 5), `version` |
| `write` | Create, replace, or append to a text file (up to 5 MB); missing folders are created | `path`, `content`, `mode` (`overwrite`, `create`, `append`), `expectedVersion` |
| `edit` | Replace exact text in a text file | `path`, `oldText`, `newText`, `replaceAll`, `expectedVersion` |
| `mkdir` | Create a folder and any missing parents | `path` |
| `move` | Move into a folder, or rename by giving a new path | `path`, `destinationPath`, `confirm` |
| `trash` | Move to the trash | `path` |

`write`, `edit`, `mkdir`, `move` and `trash` need Editor access on the item or folder for the acting identity. Every write and edit is a new version of the file. `edit` fails with `EDIT_NO_MATCH` when `oldText` is not in the file and with `EDIT_AMBIGUOUS` when it occurs more than once; `write` and `edit` fail with `VERSION_CONFLICT` when `expectedVersion` is stale. Each error carries a `hint` that names the next call.

The arguments and their limits match the [Drive API](/docs/api/autessadb-drive.md). Any argument can be a `@@{...}` placeholder the agent fills at run time. Set `rootPath` to confine the tool to one folder: every path the agent sends is resolved inside it, and nothing outside it is visible even if the acting identity could see more.

The tool sees only what its acting identity can open. When an agent acts for a user, results are exactly what that user would see in the explorer.

When a Drive is bound to an agent, the agent receives one narrow tool per operation (`drive_ls`, `drive_tree`, `drive_find`, `drive_stat`, `drive_grep`, `drive_read`, `drive_search`, `drive_fetch`, `drive_write`, `drive_edit`, `drive_mkdir`, `drive_move`, and `drive_trash`) with guidance to use search for topics, grep for exact strings, read the page or lines before quoting, and edit files by reading them first and copying the exact text to replace.

The result is `{"output": "...", "data": {...}}`. `output` is formatted for the model: listings as aligned text, grep hits as `path (vN) p3:L12: ...match...`, and `read` as numbered lines. `data` carries the same structured response as the API, including `nextCursor` and `truncated`. Cite results as `path p.N L.M`. A `fetch` with `view: true` also returns the images the model sees, in the same way as [Fetch and View](/docs/tools/media-web.md#fetch-and-view-).

### Example config

```json title="Tool config"
{
  "toolType": "AUTESSADB_DRIVE",
  "tableId": "V1StGXR8Z5",
  "op": "grep",
  "rootPath": "/Shared/Legal",
  "pattern": "@@{PATTERN}",
  "caseInsensitive": true,
  "context": 1
}
```

```text title="output"
/Shared/Legal/Contracts/acme-msa.pdf (v2) p4:L12: 12.2 **Termination for Convenience**. Either party may terminate this Agreement
/Shared/Legal/Contracts/globex-msa.pdf (v1) p7:L3: 9.1 **Termination for Convenience**. Customer may terminate upon thirty (30) days
2 matches in 2 files. 1 file in scope is still processing.
```

**Configuration fields**

- `tableId` (string (ID)) — Required string (ID) value. References an AutessaDB table by ID.
- `op` (string) — ls | tree | find | stat | grep | read | search | fetch | write | edit | mkdir | move | trash | comment
- `rootPath` (string) — Hard scope ceiling, e.g. `/Shared/Contracts`; null = the whole Drive (as the identity sees it).
- `path` (string) — Hard scope ceiling, e.g. `/Shared/Contracts`; null = the whole Drive (as the identity sees it).
- `nodeId` (integer) — Hard scope ceiling, e.g. `/Shared/Contracts`; null = the whole Drive (as the identity sees it).
- `glob` (string) — Hard scope ceiling, e.g. `/Shared/Contracts`; null = the whole Drive (as the identity sees it).
- `nameRegex` (string) — Hard scope ceiling, e.g. `/Shared/Contracts`; null = the whole Drive (as the identity sees it).
- `type` (string) — Hard scope ceiling, e.g. `/Shared/Contracts`; null = the whole Drive (as the identity sees it).
- `mime` (string) — Hard scope ceiling, e.g. `/Shared/Contracts`; null = the whole Drive (as the identity sees it).
- `modifiedAfter` (string) — Hard scope ceiling, e.g. `/Shared/Contracts`; null = the whole Drive (as the identity sees it).
- `modifiedBefore` (string) — Hard scope ceiling, e.g. `/Shared/Contracts`; null = the whole Drive (as the identity sees it).
- `sizeGt` (integer) — Hard scope ceiling, e.g. `/Shared/Contracts`; null = the whole Drive (as the identity sees it).
- `sizeLt` (integer) — Hard scope ceiling, e.g. `/Shared/Contracts`; null = the whole Drive (as the identity sees it).
- `pattern` (string) — Hard scope ceiling, e.g. `/Shared/Contracts`; null = the whole Drive (as the identity sees it).
- `regex` (boolean) — Hard scope ceiling, e.g. `/Shared/Contracts`; null = the whole Drive (as the identity sees it).
- `caseInsensitive` (boolean) — Hard scope ceiling, e.g. `/Shared/Contracts`; null = the whole Drive (as the identity sees it).
- `outputMode` (string) — Hard scope ceiling, e.g. `/Shared/Contracts`; null = the whole Drive (as the identity sees it).
- `context` (integer) — Hard scope ceiling, e.g. `/Shared/Contracts`; null = the whole Drive (as the identity sees it).
- `maxMatchesPerFile` (integer) — Hard scope ceiling, e.g. `/Shared/Contracts`; null = the whole Drive (as the identity sees it).
- `pages` (string) — Hard scope ceiling, e.g. `/Shared/Contracts`; null = the whole Drive (as the identity sees it).
- `lines` (string) — Hard scope ceiling, e.g. `/Shared/Contracts`; null = the whole Drive (as the identity sees it).
- `maxChars` (integer) — Hard scope ceiling, e.g. `/Shared/Contracts`; null = the whole Drive (as the identity sees it).
- `query` (string) — Hard scope ceiling, e.g. `/Shared/Contracts`; null = the whole Drive (as the identity sees it).
- `mode` (string) — Hard scope ceiling, e.g. `/Shared/Contracts`; null = the whole Drive (as the identity sees it).
- `topK` (integer) — Hard scope ceiling, e.g. `/Shared/Contracts`; null = the whole Drive (as the identity sees it).
- `maxDepth` (integer) — Hard scope ceiling, e.g. `/Shared/Contracts`; null = the whole Drive (as the identity sees it).
- `maxEntries` (integer) — Hard scope ceiling, e.g. `/Shared/Contracts`; null = the whole Drive (as the identity sees it).
- `limit` (integer) — Hard scope ceiling, e.g. `/Shared/Contracts`; null = the whole Drive (as the identity sees it).
- `cursor` (string) — Hard scope ceiling, e.g. `/Shared/Contracts`; null = the whole Drive (as the identity sees it).
- `sort` (string) — Hard scope ceiling, e.g. `/Shared/Contracts`; null = the whole Drive (as the identity sees it).
- `foldersOnly` (boolean) — Hard scope ceiling, e.g. `/Shared/Contracts`; null = the whole Drive (as the identity sees it).
- `content` (string) — write: the text; append mode adds it to the end.
- `oldText` (string) — edit: the exact text to replace, and its replacement.
- `newText` (string) — edit: the exact text to replace, and its replacement.
- `replaceAll` (boolean) — edit: the exact text to replace, and its replacement.
- `expectedVersion` (integer) — write / edit: fail with VERSION_CONFLICT unless the file is at this version.
- `view` (boolean) — fetch: show the image / PDF pages to the model.
- `version` (integer) — fetch: an earlier version.
- `destinationPath` (string) — move: the folder to move into, or the new full path.
- `confirm` (boolean) — move: proceed although access changes.
- `action` (string) — comment: `add` (default) or `list`.
- `body` (string) — comment add: the comment text.
- `page` (integer) — comment add: anchor the comment to this page (1-based).
- `quote` (string) — comment add: the exact words the comment is about (found in the file's text and highlighted).
- `range` (string) — comment add (spreadsheets): the cell or range the comment is about, such as B3:D7.
- `sheet` (string) — comment add (spreadsheets): the sheet of range.
- `parentId` (string) — comment add: reply to this comment's thread (its id from a list).
- `includeResolved` (boolean) — comment list: include resolved threads.

## Describe Analytics Tables

**TOOL** `ANALYTICS_DESCRIBE`

Tells an agent what one or more [columnar tables](/docs/guide/autessadb/analytics.md) contain, so it can write correct SQL. The agent should call it before its first query. Columns the acting identity cannot see are left out.

The result is markdown, one section per table: SQL name, description, grain, row count, last load time, the partition columns ("filter on these"), each column with its type, description, synonyms, and (with `includeStats`) its most common values, the measures as `name := sql`, joins, and verified queries.

### Example config

```json title="Tool config"
{
  "toolType": "ANALYTICS_DESCRIBE",
  "tableIds": ["V1StGXR8Z5", "Hq4ZpN8sXe"],
  "includeStats": true
}
```

**Configuration fields**

- `tableIds` (array<integer>) — The analytics tables this tool may describe (and nothing else). References an AutessaDB table by ID.
- `includeStats` (boolean) — Include column statistics (null counts, ranges, top values).

## Query Analytics Tables

**TOOL** `ANALYTICS_QUERY`

Runs one read-only SQL query, written in ANSI SQL, over the columnar tables listed in `tableIds`. Usually `sql` is `@@{sql}` so the agent writes the query; it can also be fixed SQL with placeholders for values. `mode` is `RUN` (default), `PREVIEW` (a quick sample), or `ESTIMATE` (report how much data the query would scan, without running it). Queries can only read the tables in `tableIds`, and row-level and field-level security apply.

Queries typically take a few seconds. `maxRows` caps the rows returned to the agent (default 200, maximum 1,000). The tool waits up to `maxWaitSeconds` (default 25) for the query; if it is still running, the result is `{"state": "RUNNING", "jobId": "...", "hint": "call ANALYTICS_GET_RESULT"}`.

A finished result is `{"jobId", "state", "columns", "rows", "totalRows", "truncated", "bytesScanned", "elapsedMs", "markdown"}`, where `markdown` is a table of up to 50 rows for the model to read. A failed query returns `{"errorCode", "errorMessage", "hint"}` with codes such as `PARSE_ERROR`, `UNKNOWN_TABLE`, `UNKNOWN_COLUMN` (the hint lists the real columns), and `SCAN_LIMIT` (the hint names the partition columns to filter on). See the [Analytics API errors](/docs/api/autessadb-analytics.md#errors). Download links are never put in the model's context.

### Example config

```json title="Tool config"
{
  "toolType": "ANALYTICS_QUERY",
  "tableIds": ["V1StGXR8Z5", "Hq4ZpN8sXe"],
  "sql": "@@{sql}",
  "mode": "RUN",
  "maxRows": 200,
  "maxWaitSeconds": 25
}
```

**Configuration fields**

- `tableIds` (array<integer>) — The analytics tables the SQL may reference. References an AutessaDB table by ID.
- `sql` (string) — The SQL (normally filled by the LLM through the `@@{sql`} argument).
- `mode` (string) — RUN (default) | PREVIEW | ESTIMATE.
- `maxRows` (integer) — Rows returned to the agent (default 200, at most 1000).
- `maxWaitSeconds` (integer) — How long to wait for the result before returning the jobId (default 25 s).
- `maxBytesScanned` (integer) — Refuse queries that would scan more than this many bytes (default: the company limit).

## Get Analytics Result

**TOOL** `ANALYTICS_GET_RESULT`

Fetches the result of a query started by [Query Analytics Tables](#query-analytics-tables): waits up to `waitSeconds` for a running job, then returns one page of rows (`pageSize` up to 200) in the same shape as a finished query. Use it when a query returned `RUNNING`, or to page past the first rows of a large result.

### Example config

```json title="Tool config"
{
  "toolType": "ANALYTICS_GET_RESULT",
  "jobId": "@@{jobId}",
  "page": "@@{page}",
  "pageSize": 200,
  "waitSeconds": 20
}
```

**Configuration fields**

- `tableIds` (array<integer>) — The analytics tables whose jobs this tool may read. References an AutessaDB table by ID.
- `jobId` (string) — The job id returned by ANALYTICS_QUERY (normally `@@{jobId`}).
- `page` (integer) — 1-based result page (default 1).
- `pageSize` (integer) — Rows per page (default and max 200).
- `waitSeconds` (integer) — Wait up to this long for a running job to finish (default 20 s, max 25 s).

The three analytics tools are usually created together, bound to the same tables, with **Create agent tools** on the table's page or the [`create-agent-tools`](/docs/api/poweruser/autessadb-analytics.md#create-agent-tools) endpoint.

## Related

- [Tool Types overview](/docs/tools.md)
- [AutessaDB tables guide](/docs/guide/autessadb/tables.md)
- [AutessaDB Drive guide](/docs/guide/autessadb/drive.md) and [Drive API](/docs/api/autessadb-drive.md)
- [Columnar tables guide](/docs/guide/autessadb/analytics.md) and [AutessaDB - Columnar API](/docs/api/autessadb-analytics.md)
- [Poweruser AutessaDB query API](/docs/api/poweruser/autessadb-query.md)
- [Core tool types](/docs/tools/core.md) — `GET_FILE_CONTENT_FROM_TABLE` extracts text from files stored in table rows
- [Tools guide](/docs/guide/agentic/tools.md)

