list_columns | List the columns of a table: {columns:[{id, fields:{label, type, widgetOptions (JSON string, e.g. Choice options), isFormula, …}}]}. The column id is the key to use in fields / filter / sort. docId: string, required; tableId: string, required, from list_tables. |
list_orgs | List the Grist sites (team sites or personal area) the key can access: [{id, name, domain, …}]. Use an id with list_workspaces. Also used as the credential probe. No arguments. |
list_records | List the records of a table: {records:[{id, fields:{<column id>: value}}]}. docId: string, required; tableId: string, required. Optional: filter (object { “<column id>”: [allowed values] }, e.g. {“Status”:[“open”,“pending”],“Size”:[“S”]}: a record must match one value of EACH listed column; exact match only); sort (string, column ids comma-separated, ”-” prefix = descending, e.g. “Status,-Amount”; without it the order is unspecified); limit (integer, max records returned, 0 = no limit). |
list_tables | List the tables of a document: {tables:[{id, fields}]}. The table id (string) is needed by the record actions. docId: string, required, from list_workspaces. |
list_workspaces | List the workspaces of a site with the documents they contain: [{id, name, docs:[{id, name, …}]}]. The document id (docs[].id, string) is needed by every other action. orgId: integer id from list_orgs, or the string “current” for the site of the configured domain (required). |
run_sql | Run a read-only SQL SELECT query against a document (SQLite; WITH clauses allowed, a single statement without trailing semicolon, nothing that modifies data); answer {statement, records:[{fields:{…}}]}. Tables and columns are named by their ids (see list_tables, list_columns). Arguments: docId (string, required, from list_workspaces); q (string, required, the SQL query, e.g. “select * from Contacts where Amount > 100 limit 20”). |