Contents

Get Table

get_table · Tools · Tables

Read one table's declaration, including every column's type

Parameters

NameTypeRequiredDescription
table_idstringYesThe table's id or slug, as list_tables gives them; the slug aliases the id and either is accepted.

Get Table Tool#

Reads one table's full declaration.

When to Use#

Use this before writing rows. list_tables names a table's columns but not their interiors, and the interior is what a write has to satisfy: a select names the values it admits, an object names its keys, a resource names the kind of thing it points at.

Parameters#

Parameter Type Required Description
table_id string Yes The table's id or slug, as list_tables gives them; the slug aliases the id and either is accepted

Returns#

Field Type Description
success boolean Whether the read succeeded
table_id string The table's slug
name string Display name
description string | null What the table holds
id_format string Row id format: string or number
row_count number Rows in the table, broken ones included
columns array Every declared column: { name, column_type, nullable, indexed, description }

Example#

{ "table_id": "reading-list" }

Notes#

  • column_type is tagged by kind, so a select arrives with its options and an object with its fields. Write values that satisfy them; a violation is refused rather than stored.
  • indexed is the column's declared setting: an index speeds up eq and in filters, and range filters and sorts on number and date columns. Indexes are built in the background shortly after a save.
  • Refused with ai_access_denied when the table's AI access policy denies reads.