Tables
Space MCP tools in the Tables scope (tables). Reach these with a wks_live_ key over space-mcp or space-api.
Tools in the tables scope, callable over space-mcp (tools/call) or space-api (REST) with a wks_live_* key that grants tables.
add_row_comment
Scope: tables:write
Add a comment to a table row's discussion thread (posted as the agent). Tag people, agents or anything in the space with @ — write the mention find_to_mention gives ("@Julie [member:…]"): a person tagged is notified, an agent tagged is told in its chat.
| Parameter | Type | Required | Description |
|---|---|---|---|
table_id | string | yes | |
row_id | string | yes | |
body | string | yes |
create_table
Scope: tables:write
Create a new table. Pass name (plural label, e.g. 'Invoices') and optionally columns to define the schema in one call — same shape as create_table_column args ({key,label,type,...}). Slug is auto-generated and de-duplicated. The first text column becomes the row title unless title_field_key is set.
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | yes | Plural label, e.g. 'Invoices'. |
singular_label | string | Defaults to name. | |
slug | string | ||
icon | string | Lucide icon name or emoji. | |
color | string | ||
description | string | ||
title_field_key | string | ||
columns | object[] | Initial columns: [{key,label,type,options?,reference_target?,field_config?,required?,default_value?,icon?}]. |
create_table_column
Scope: tables:write
Add a column to a table. key must be snake_case (^[a-z][a-z0-9_]*$). All field types are supported (text, number, select, rating, attachment, formula, lookup, rollup, ...). For select/multi_select pass options:[{value,label,color?}]; for a column people fill by picking a contact/task/event/row, use type 'reference' with reference_target:{kind:'contact'|'task'|'calendar_event'} or {kind:'table',table_id} (a table of this space) — required; for formula/lookup/rollup/button/currency-style config pass field_config (formula: {expression}, lookup: {source_column_key,target_column_key}, rollup: {source_column_key,target_column_key,aggregator}).
| Parameter | Type | Required | Description |
|---|---|---|---|
table_id | string | yes | |
key | string | yes | snake_case column key, e.g. 'vin'. |
label | string | yes | |
type | text | long_text | number | boolean | date | time | url | email | phone | select | multi_select | rating | member | json | reference | created_time | last_edited_time | created_by | last_edited_by | autonumber | attachment | duration | rich_text | geolocation | button | document | formula | lookup | rollup | yes | |
description | string | ||
options | array | select/multi_select choices: [{value,label,color?}]. | |
reference_target | object | reference target: {kind:'contact'} or {kind:'table',table_id}. | |
field_config | object | Type-specific config (formula expression, lookup/rollup source, button action, number format, ...). | |
required | boolean | ||
unique | boolean | No duplicates: refuse a second row with the same value (text, long_text, email, phone, url, number; case/space-blind, phones by digits). Turning it on over existing duplicates is refused, naming one. | |
default_value | — | ||
display_order | number | ||
icon | string | Optional emoji shown in the column header. |
create_table_row
Scope: tables:write
Create a row in a table. Pass column values in data (column key → value). Link cells take what you know: a contact column its contact's id, email, phone or exact name; a task/event column its id or exact title; a table-link column the linked row's id or exact title; a member column a user id (list_space_members). null clears. A select cell takes an option's value or label. A value that names nothing in this space is refused by name.
| Parameter | Type | Required | Description |
|---|---|---|---|
table_id | string | yes | |
data | object | yes | Map of column key → value. |
create_table_rows
Scope: tables:write
Bulk-insert up to 100 rows into a table in one call. rows is an array of data objects (column key → value). Link cells take ids, emails, phones or exact titles, as in create_table_row.
| Parameter | Type | Required | Description |
|---|---|---|---|
table_id | string | yes | |
rows | object[] | yes |
create_table_share_link
Scope: tables:write
Create a PUBLIC view-only share link for a table. Anyone with the URL sees a read-only rendering of the given view (its filters and hidden fields are enforced server-side). Omit view_id to share the table's default view. Returns the shareable URL.
| Parameter | Type | Required | Description |
|---|---|---|---|
table_id | string | yes | |
view_id | string | Share this specific view. Defaults to the table's default view. | |
name | string | Label shown in the share-links list. |
create_table_snapshot
Scope: tables:write
Capture a named save point of a table's full state (schema + rows + views). Do this before risky bulk edits so the user can restore.
| Parameter | Type | Required | Description |
|---|---|---|---|
table_id | string | yes | |
label | string |
create_table_view
Scope: tables:write
Create a view for a table. type: grid | kanban | calendar. config holds the per-view filters/sort/group/hidden fields (kanban needs config.group_by, calendar needs config.date_field). To show a table any other way — cards with photos, charts, a feed, a map — build an app over the table (create_app, wakato.tables.* reads and writes it live); there are no gallery or dashboard views.
| Parameter | Type | Required | Description |
|---|---|---|---|
table_id | string | yes | |
name | string | yes | |
type | grid | kanban | calendar | Defaults to grid. | |
config | object | Per-view filters/sort/grouping/layout settings. | |
display_order | number | ||
is_default | boolean | Make this the table's default view (clears any prior default). |
decide_table_access_request
Scope: tables:write
Answer someone who asked to use a table (get_table_access lists requests): accept lets them in at level (default read), false says not now. They are told either way. Always asks the owner first.
| Parameter | Type | Required | Description |
|---|---|---|---|
table_id | string | yes | |
request_id | string | yes | |
accept | boolean | yes | |
level | read | edit | fill | change |
delete_table
Scope: tables:write
Delete a table. Default is ARCHIVE (reversible via update_table {archived:false}). Pass hard_delete:true to permanently delete the table and all its rows/columns/views — a safety snapshot is captured first.
| Parameter | Type | Required | Description |
|---|---|---|---|
table_id | string | yes | |
hard_delete | boolean |
delete_table_column
Scope: tables:write
Delete a table column (drops its data from all rows).
| Parameter | Type | Required | Description |
|---|---|---|---|
column_id | string | yes |
delete_table_row
Scope: tables:write
Delete one row from a table. Irreversible (but the table History keeps a before-state).
| Parameter | Type | Required | Description |
|---|---|---|---|
table_id | string | yes | |
row_id | string | yes |
delete_table_rows
Scope: tables:write
Bulk-delete up to 100 rows by id in one call.
| Parameter | Type | Required | Description |
|---|---|---|---|
table_id | string | yes | |
row_ids | string[] | yes |
delete_table_view
Scope: tables:write
Delete a table view.
| Parameter | Type | Required | Description |
|---|---|---|---|
view_id | string | yes |
get_table
Scope: tables:read
Get one table's full definition: metadata, columns (schema), views, and row count. Call this before reading/writing rows so you know the column keys and types.
| Parameter | Type | Required | Description |
|---|---|---|---|
table_id | string | yes |
get_table_access
Scope: tables:write
Who can use a table and how far — the table's “Who can use it”: every person in the space with their level (No access · Read · Edit what's in it · Add & remove rows · Change the table), whether they're kept to their own rows, columns hidden from them and WHERE it comes from (their own line, a team, Everyone else, their Tables permission); the space's teams with their lines; Everyone else; whose row is it; pending requests to get in. People, not agents — an agent's reach is its Can use.
| Parameter | Type | Required | Description |
|---|---|---|---|
table_id | string | yes |
get_table_history
Scope: tables:read
What changed in a table, by whom and when — the table's History: sessions newest first (who, summary, how many edits, its restore point). With session_id: that session's edits, each row edit listing the fields it changed (before → after). To undo, restore_table_snapshot the restore point of the session before the change.
| Parameter | Type | Required | Description |
|---|---|---|---|
table_id | string | yes | |
session_id | string | One session's edits (from a previous call). | |
limit | number |
get_table_view
Scope: tables:read
Get one table view including its full config (filters, sort, grouping, layout settings).
| Parameter | Type | Required | Description |
|---|---|---|---|
view_id | string | yes |
list_row_comments
Scope: tables:read
List the comment thread on a table row (oldest first).
| Parameter | Type | Required | Description |
|---|---|---|---|
table_id | string | yes | |
row_id | string | yes | |
limit | number |
list_table_columns
Scope: tables:read
List a table's columns (its schema). Needed before creating rows so you know the column keys/types.
| Parameter | Type | Required | Description |
|---|---|---|---|
table_id | string | yes |
list_table_rows
Scope: tables:read
List/query rows of a table with optional filters (AND-combined, ops: eq|neq|contains|gt|lt|is_empty|is_not_empty on column keys), multi-column sort, and search (substring match on the title column, or search_column). Returns rows plus total/has_more for pagination.
| Parameter | Type | Required | Description |
|---|---|---|---|
table_id | string | yes | |
limit | number | ||
offset | number | ||
filters | object[] | [{column_key, op, value?}] — AND-combined. | |
sort | object[] | [{column_key, direction:'asc'|'desc'}] — also accepts created_at/updated_at. | |
search | string | ||
search_column | string |
list_table_share_links
Scope: tables:read
List a table's public view-only share links (URL, view, revoked state).
| Parameter | Type | Required | Description |
|---|---|---|---|
table_id | string | yes |
list_table_snapshots
Scope: tables:read
List a table's Time Machine snapshots (save points + auto-captured session snapshots), newest first.
| Parameter | Type | Required | Description |
|---|---|---|---|
table_id | string | yes | |
limit | number |
list_table_views
Scope: tables:read
List the saved views (grid/kanban/calendar) of a table. Per-view filters/sort/group live in each view's config.
| Parameter | Type | Required | Description |
|---|---|---|---|
table_id | string | yes |
list_tables
Scope: tables:read
List user-defined tables (record types) in the space.
restore_table_snapshot
Scope: tables:write
Restore a table to a snapshot's state (schema + rows + views). Atomic; a pre-restore snapshot is captured automatically so this is reversible.
| Parameter | Type | Required | Description |
|---|---|---|---|
snapshot_id | string | yes |
revoke_table_share_link
Scope: tables:write
Revoke a public share link — the URL stops working immediately.
| Parameter | Type | Required | Description |
|---|---|---|---|
link_id | string | yes |
set_table_access
Scope: tables:write
Set what a PERSON, a TEAM, or everyone else in the space may do on a table — one line: user_id, team_id or everyone:true. level: none · read · edit (what's in the rows) · fill (add & remove rows) · change (the table itself), or null to take the line away (they fall back to their team / Everyone else / Tables permission). own_rows keeps them to rows they added or that the table's person column names (set_table_own_rows_column). hidden_columns: columns they never see or write. The space's owner and admins always have everything. Everyone whose access changes is told. Always asks the owner first.
| Parameter | Type | Required | Description |
|---|---|---|---|
table_id | string | yes | |
user_id | string | A person in the space (list_space_members). | |
team_id | string | A team of the space (list_teams). | |
everyone | boolean | Everyone else in the space — anyone without their own or a team's line. | |
level | none | read | edit | fill | change | null | ||
own_rows | boolean | ||
hidden_columns | string[] | Column keys hidden from them. |
set_table_own_rows_column
Scope: tables:write
Whose row is it, for people kept to their own rows: the rows they added, plus — when a person (member) column is named here — the rows where that column names them. column_key null = only who added it.
| Parameter | Type | Required | Description |
|---|---|---|---|
table_id | string | yes | |
column_key | string,null | A member column's key, or null. |
set_table_web_publishing
Scope: tables:write
Let web pages show a table's rows — or take it off the web. A page shows a table (<div data-wakato-table="<id>">) only when the table is published, only the columns listed here, at most max_rows. Always asks the owner first: it puts the table's contents on public pages. published:false empties every page using it from the next view.
| Parameter | Type | Required | Description |
|---|---|---|---|
table_id | string | yes | |
published | boolean | yes | |
visible_columns | string[] | Column keys a visitor may see — the only ones sent to a page. Required the first time it is published. | |
max_rows | number | The most rows any page receives (default 100). |
table_totals
Scope: tables:read
Totals of a table, computed exactly in the database whatever its size: count rows, sum / average / min / max a number column, count distinct values — for the whole table, or grouped by a column (e.g. per Status, per customer) or by day / week / month / quarter / year of a date column, with filters. Use this to answer how much, how many, per what, per month — never page through rows to add them up yourself. Name columns by key or label. metrics: "count", "sum:Order Amount", "avg:Order Amount", or [{op, column, as?}]. filters: [{column, op, value}] (eq|neq|gt|gte|lt|lte|contains|is_empty|is_not_empty) or {column: value}; a select filter takes the option's label, a link filter an email / name / title. Groups come back biggest first (order:"key" for in order), each with key, a readable label, and the metrics.
| Parameter | Type | Required | Description |
|---|---|---|---|
table_id | string | yes | |
metrics | — | What to total: "count" (default), "sum:<column>", "avg:<column>", "min:<column>", "max:<column>", "count_distinct:<column>", or [{op, column, as?}] — up to 10. | |
group_by | string | Column (key or label) to break the totals down by; created_at / updated_at too. | |
bucket | hour | day | week | month | quarter | year | With a date column in group_by: one group per period. | |
filters | — | [{column, op, value}] AND-combined, or {column: value}. | |
order | value | key | value = biggest first (default); key = in order (a time series). | |
limit | number | Most groups to return (default 100, max 1000). |
update_table
Scope: tables:write
Edit table metadata: labels, slug, icon, color, description, title_field_key, display_order. Pass archived:true to archive (hide) the table, archived:false to restore it.
| Parameter | Type | Required | Description |
|---|---|---|---|
table_id | string | yes | |
name | string | Alias for plural_label. | |
singular_label | string | ||
plural_label | string | ||
slug | string | ||
icon | string | ||
color | string | ||
description | string | ||
title_field_key | string | ||
display_order | number | ||
archived | boolean |
update_table_column
Scope: tables:write
Edit a table column (label, type, options, required, no duplicates, etc.).
| Parameter | Type | Required | Description |
|---|---|---|---|
column_id | string | yes | |
key | string | ||
label | string | ||
type | text | long_text | number | boolean | date | time | url | email | phone | select | multi_select | rating | member | json | reference | created_time | last_edited_time | created_by | last_edited_by | autonumber | attachment | duration | rich_text | geolocation | button | document | formula | lookup | rollup | ||
description | string | ||
options | array | ||
reference_target | object | ||
field_config | object | ||
required | boolean | ||
unique | boolean | No duplicates (see create_table_column). | |
default_value | — | ||
display_order | number | ||
icon | string |
update_table_row
Scope: tables:write
Patch a row's data (merged into existing JSON, not replaced). Link cells take ids, emails, phones or exact titles, as in create_table_row.
| Parameter | Type | Required | Description |
|---|---|---|---|
table_id | string | yes | |
row_id | string | yes | |
data | object | yes |
update_table_rows
Scope: tables:write
Bulk-patch up to 100 rows in one call. updates = [{row_id, data}] — each data object is merged into that row. Per-row failures are reported, not fatal.
| Parameter | Type | Required | Description |
|---|---|---|---|
table_id | string | yes | |
updates | object[] | yes |
update_table_view
Scope: tables:write
Edit a table view (name, type, config, order, or default flag).
| Parameter | Type | Required | Description |
|---|---|---|---|
view_id | string | yes | |
name | string | ||
type | grid | kanban | calendar | ||
config | object | ||
display_order | number | ||
is_default | boolean |