records
The records.* tools of the Runbase MCP server, generated from their definitions.
records.delete
Moves a record to the trash: it disappears from reads, searches and SQL queries; its relations (ref/refs) are removed and its timeline kept. Restorable for 30 days (records.restore), then purged.
| Name | Type | Required | Description |
|---|---|---|---|
id | string | yes | |
workspace | string | no | Workspace id or name (default: active workspace) |
records.delete_where
Moves to the trash all records of an object matching the filter (max 10000). Preview required: dryRun: true (returns { count }), then expected = that count.
| Name | Type | Required | Description |
|---|---|---|---|
object | string | yes | Object slug or id (uuid) |
filter | __schema0 | yes | |
dryRun | boolean | no | |
expected | integer | no | |
workspace | string | no | Workspace id or name (default: active workspace) |
records.get
Reads a record by id, refs resolved. include: relation paths (e.g. company, contact.company, reverse relation contact) -> included.
| Name | Type | Required | Description |
|---|---|---|---|
id | string | yes | |
include | array | no | |
workspace | string | no | Workspace id or name (default: active workspace) |
records.history
A record's history (most recent first): creation, updates with diff { changed, before, after }, deletion, restore, actor and date.
| Name | Type | Required | Description |
|---|---|---|---|
id | string | yes | |
workspace | string | no | Workspace id or name (default: active workspace) |
records.import_csv
Imports a CSV (1st line = headers, max 10000 lines). mapping { column: field key }; match = unique field (e.g. email) to update the existing record instead of creating a duplicate. Lists: JSON or values separated by ";". Each line is independent: returns { total, created, updated, unchanged, failed: [{ line, error }] }. dryRun: true to check without writing.
| Name | Type | Required | Description |
|---|---|---|---|
object | string | yes | Object slug or id (uuid) |
csv | string | yes | |
mapping | object | yes | |
match | string | no | |
dryRun | boolean | no | |
workspace | string | no | Workspace id or name (default: active workspace) |
records.merge
Merges duplicates into keep, atomically: its values win, empty fields are filled, the merged records' relations (ref/refs) and events move to keep, then they are deleted.
| Name | Type | Required | Description |
|---|---|---|---|
keep | string | yes | |
merge | array | yes | |
workspace | string | no | Workspace id or name (default: active workspace) |
records.purge
Empties the trash permanently: the given ids, otherwise the whole given object, otherwise the whole workspace. Irreversible: confirm: true required.
| Name | Type | Required | Description |
|---|---|---|---|
object | string | no | Object slug or id (uuid) |
ids | array | no | |
confirm | boolean | no | |
workspace | string | no | Workspace id or name (default: active workspace) |
records.restore
Restores a record from the trash: same id, values, timeline and relations restored. Fails if its unique value or externalId has been taken in the meantime.
| Name | Type | Required | Description |
|---|---|---|---|
id | string | yes | |
workspace | string | no | Workspace id or name (default: active workspace) |
records.revert
Restores the values from before an update: auditId = id of a record.update entry from records.history. Creates a new update.
| Name | Type | Required | Description |
|---|---|---|---|
id | string | yes | |
auditId | string | yes | |
workspace | string | no | Workspace id or name (default: active workspace) |
records.search
Searches an object's records (DSL filter all/any of { field, op, value }; ops: eq, neq, gt, gte, lt, lte, between, in, not_in, contains, starts_with, ends_with, regex (case-sensitive), before, after, within, older_than, is, is_empty, is_not_empty). q: free text (trigram index). Returns { records, hasMore, total, next }. Pagination: after = next of the previous page (keyset, works with any sort). view: name of a saved view (its filter is added, its sort applies when there is no sort).
| Name | Type | Required | Description |
|---|---|---|---|
object | string | yes | Object slug or id (uuid) |
filter | __schema0 | no | |
sort | array | no | |
q | string | no | |
view | string | no | |
limit | integer | no | |
after | string | no | |
workspace | string | no | Workspace id or name (default: active workspace) |
records.transact
Several writes (upsert, update, delete; different objects allowed) in a single transaction: one error cancels everything. Max 1000. "$n" (0-based index) refers to the record id of a previous op n: usable in id and in ref/refs fields (e.g. { company: "$0" }).
| Name | Type | Required | Description |
|---|---|---|---|
ops | array | yes | |
workspace | string | no | Workspace id or name (default: active workspace) |
records.trash
An object's trash: deleted records (most recent first), with deletedAt and purgeAt (automatic purge). Next page: after = id of the last item.
| Name | Type | Required | Description |
|---|---|---|---|
object | string | yes | Object slug or id (uuid) |
limit | integer | no | |
after | string | no | |
workspace | string | no | Workspace id or name (default: active workspace) |
records.update
Updates a record by id (merge by default, or replace).
| Name | Type | Required | Description |
|---|---|---|---|
id | string | yes | |
data | object | yes | |
mode | string | no | One of: merge, replace. |
workspace | string | no | Workspace id or name (default: active workspace) |
records.update_where
Updates (merge) all records of an object matching the filter (max 10000). Preview required: call with dryRun: true (returns { count }), then with expected = that count.
| Name | Type | Required | Description |
|---|---|---|---|
object | string | yes | Object slug or id (uuid) |
filter | __schema0 | yes | |
data | object | yes | |
dryRun | boolean | no | |
expected | integer | no | |
workspace | string | no | Workspace id or name (default: active workspace) |
records.upsert
Creates or updates a record, validated against the object's schema. Key: externalId, or match = key of a unique: true field (email, domain); without a key, always creates. test: true: test record (on creation), deleted by workspace.purge_test.
| Name | Type | Required | Description |
|---|---|---|---|
test | boolean | no | Test data: deleted by workspace.purge_test |
externalId | string | no | |
match | string | no | |
data | object | yes | |
mode | string | no | One of: merge, replace. |
object | string | yes | Object slug or id (uuid) |
workspace | string | no | Workspace id or name (default: active workspace) |
records.upsert_batch
Upserts several records of an object (max 1000), atomically: one invalid item cancels the whole batch.
| Name | Type | Required | Description |
|---|---|---|---|
object | string | yes | Object slug or id (uuid) |
items | array | yes | |
workspace | string | no | Workspace id or name (default: active workspace) |