create_table
Create a new data table, optionally with its initial rows, atomically. Prefer one call with columns and rows when the data is already available.
Args: name: Table name description: What the table is for columns: JSON array of {name, key, data_type, config, is_required}. Use explicit unique keys when supplying initial rows, so no schema lookup is needed before inserting data. The FIRST column becomes the primary column (the row title). Omit to get a single “Name” text column you can extend later with add_table_columns. data_type: see the column type guide on this parameter. Media cells contain an ordered list of org workspace file IDs (memfile_…), or /org/ paths on write; query_table_rows returns media_files with paths and file_asset IDs. Use read_file/view_media to inspect assets before creating ads. For select / multi_select, pass the choices as config: {“options”: [{“value”: “Open”}, …]}. rows: Optional JSON array of {column_key: value} objects. Keys match the columns’ explicit keys (or “name” for the default column). Invalid rows roll back the table and columns too. This creates a new table, not an upsert: after an uncertain response, list_tables to check whether it exists before retrying.
Returns: The created table’s schema, same shape as get_table, plus created and row_ids when initial rows were supplied.
Parameters#
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
name | string | yes | Table name | |
description | string | no | "" | What the table is for |
columns | array | no | Array of {name, key, data_type, config, is_required}. Set is_required: true for mandatory values (not required). For select/multi_select, use config: {“options”: [{“value”: “Open”}]}, not top-level options. Explicit keys are used by row payloads. Unknown column fields are rejected. JSON-encoded arrays are also accepted. Column types (data_type): Text: text = any string; email = an email address string; url = a URL string Number: number = a number (write 0.12 for 12%, 1999.5 for $1,999.50). Display via config: {“format”: “currency”, “currency”: “EUR”} | {“format”: “percent”}, {“precision”: 0-10}; auto_number = assigned 1, 2, 3… when a new row omits it; write a number only to keep an existing id Date & time: date = a date; write YYYY-MM-DD, reads back YYYY-MM-DD; datetime = a timestamp; write ISO 8601 with a UTC offset, reads back ISO 8601 Choice: boolean = true or false; select = one option label; choices go in config: {“options”: [{“value”: “Open”}]}; multi_select = a list of option labels; choices go in config: {“options”: […]} Relations & files: linked_record = row ids from the linked table (config: {“linked_table_id”: “dtbl_…”}); people = organization member ids; media = an ordered list of org workspace image/video file ids (memfile_…) or /org/ paths | |
rows | any | no | Optional JSON array of {column_key: value} objects. Keys match the columns’ explicit keys (or “name” for the default column). Invalid rows roll back the table and columns too. This creates a new table, not an upsert: after an uncertain response, list_tables to check whether it exists before retrying. |
Generated by generate_mcp_docs from the server tool. Add to this page below this block; the block is rewritten on every run.
For number display, pass config such as {"format": "currency", "currency": "EUR", "precision": 2}
or {"format": "percent"}.
For example, create and populate a table without a separate schema lookup:
{
"name": "Centers",
"columns": [{"name": "Center name", "key": "center", "data_type": "text"}],
"rows": [{"center": "North"}, {"center": "South"}]
}Media values are ordered arrays of workspace file IDs (memfile_...). Writes also accept /org/ paths and normalize them to IDs. Only shared organization images and videos are accepted, with at most 50 files per cell. Pass [] to clear a cell.