TablesRead-only

Check a formula before saving it

validate_table_formula

Compile a formula (or a Lookup / Rollup / Count preset) against the workspace’s real schema WITHOUT saving it: reports whether it parses, what type it returns, which fields it depends on, how many relation hops it makes, and whether it is volatile (time-dependent). An invalid draft is an ANSWER here, not an error — use it before add_table_field.

Parameters

ParameterTypeRequiredDescription
tableIdstringrequiredTable the formula belongs to
sourcestringoptionalFormula source to check — fields are `{fld:<fieldId>}`, from get_table
presetobjectoptionalStructured preset to check instead
fieldIdstringoptionalThe field being edited, when checking a change to an existing formula
sampleRowsintegeroptionalRows to evaluate it against (default 3, 0 = compile only)

Example call

The tool call an MCP client sends (required arguments shown with placeholder values).

{
"tool": "validate_table_formula",
"arguments": {
"tableId": "tableId_123"
}
}

Use this tool in

Related Tables tools