Skip to Content
Runbase

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.

NameTypeRequiredDescription
idstringyes
workspacestringnoWorkspace 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.

NameTypeRequiredDescription
objectstringyesObject slug or id (uuid)
filter__schema0yes
dryRunbooleanno
expectedintegerno
workspacestringnoWorkspace 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.

NameTypeRequiredDescription
idstringyes
includearrayno
workspacestringnoWorkspace 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.

NameTypeRequiredDescription
idstringyes
workspacestringnoWorkspace 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.

NameTypeRequiredDescription
objectstringyesObject slug or id (uuid)
csvstringyes
mappingobjectyes
matchstringno
dryRunbooleanno
workspacestringnoWorkspace 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.

NameTypeRequiredDescription
keepstringyes
mergearrayyes
workspacestringnoWorkspace 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.

NameTypeRequiredDescription
objectstringnoObject slug or id (uuid)
idsarrayno
confirmbooleanno
workspacestringnoWorkspace 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.

NameTypeRequiredDescription
idstringyes
workspacestringnoWorkspace 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.

NameTypeRequiredDescription
idstringyes
auditIdstringyes
workspacestringnoWorkspace 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).

NameTypeRequiredDescription
objectstringyesObject slug or id (uuid)
filter__schema0no
sortarrayno
qstringno
viewstringno
limitintegerno
afterstringno
workspacestringnoWorkspace 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" }).

NameTypeRequiredDescription
opsarrayyes
workspacestringnoWorkspace 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.

NameTypeRequiredDescription
objectstringyesObject slug or id (uuid)
limitintegerno
afterstringno
workspacestringnoWorkspace id or name (default: active workspace)

records.update

Updates a record by id (merge by default, or replace).

NameTypeRequiredDescription
idstringyes
dataobjectyes
modestringnoOne of: merge, replace.
workspacestringnoWorkspace 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.

NameTypeRequiredDescription
objectstringyesObject slug or id (uuid)
filter__schema0yes
dataobjectyes
dryRunbooleanno
expectedintegerno
workspacestringnoWorkspace 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.

NameTypeRequiredDescription
testbooleannoTest data: deleted by workspace.purge_test
externalIdstringno
matchstringno
dataobjectyes
modestringnoOne of: merge, replace.
objectstringyesObject slug or id (uuid)
workspacestringnoWorkspace 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.

NameTypeRequiredDescription
objectstringyesObject slug or id (uuid)
itemsarrayyes
workspacestringnoWorkspace id or name (default: active workspace)

On this page