Files
baserow/docs/development
alamin-br be799d43d2 feat(mcp): share Kuma's table, field and view tools with MCP (#6442)
* feat(database): share field tools and store raw formulas without a model

MCP and Kuma need one definition of the field tools, and the MCP path has no model.
Kuma repairs invalid formulas after the shared call, outside the transaction.

* fix(assistant): run formula repair after the table transaction commits

Tables and fields are now created by shared core code in one transaction, and
Kuma repairs invalid formulas only after it commits. Closes #6297 for database.

* fix(database): save each field in its own savepoint

A database error on one field aborted the whole transaction, losing the other fields in the call.

* feat(mcp): offer Kuma's table, field and view tools

MCP clients get the field and view write tools Kuma uses, built from the same
functions, and the disabled core table and field tools they replace are gone.

* fix(database): reject bad select filter values and check every view first

A string select value made an empty filter and an int one an internal error.
A missing view left the filters of earlier views saved, so a retry duplicated them.

* refactor(database): share list_tables between MCP and Kuma

MCP gains Kuma's name filters and keeps its list output; Kuma's not-found
hint now only names and counts databases the user can see.

* refactor(database): share get_table_schema between MCP and Kuma

MCP now gets Kuma's field details (option IDs, lookup through and target,
array formula type) and keeps its old keys; Kuma reshapes the same result.

* feat(mcp): share list_applications between MCP and Kuma

Kuma's list_builders pages instead of silently stopping at 20.
list_databases stays as an alias because existing connections allow it.

* fix(assistant): keep generated formulas out of Kuma's table schema

The shared schema sends MCP the formula of lookup, count and rollup fields,
as before; Kuma only showed it for formula fields.

* test(mcp): pin that stored tool lists can't hold removed or re-enabled tools

Every write path has checked names against enabled tools since allowed_tools was
added, so no data migration is needed.

* docs(mcp): list the shared database tools in the test plan

* fix(database): log unexpected field tool errors and hide their message

The per-item loops sent raw exception text to MCP clients and never logged it.

* fix(database): report an empty formula in formula_errors

It used to fail later with "retry later" advice that Kuma's fixer never saw.

* fix(database): create the filters of all views in one transaction

An error on a later view left the earlier filters saved, and a retry duplicated them.

* fix(database): store form settings and skip view filters Baserow refuses

A form view filter or a field option error failed the call unreadably, form submit
settings were dropped, and date, boolean and select filter values were stored as
something other than what the response echoed.

* fix(database): lock updated fields and drop models cached in a rolled back item

update_fields merged select options from an unlocked read, and a failed item or a
denied table could leave the request's cached table model ahead of the database.

* fix(database): look up through the link field a lookup names

through_field was taken for a table id, so the lookup failed or linked a new field
to the wrong table, and a link field created for a lookup went unreported.

* fix(database): report a refused primary field name with the table's name

A reserved, blank or too long primary_field_name failed create_tables with
"Internal error.".

* fix(mcp): list only databases with list_applications

The tool sits in the database read group, so it must not list builders,
automations or dashboards until their groups exist.

* fix(assistant): leave empty formulas to the user and note every unrepaired one

The fixer invented a formula for a field that had none, and a permission denial
while repairing dropped the notes for the formulas still invalid.

* fix(database): validate a form view's redirect URL like the REST API

The public form navigates to it after submit, so a javascript: URL ran in Baserow's
origin. Also stops catching filter errors this path can't raise.

* fix(database): match a lookup's through_field name ignoring case and spaces

Select labels are matched that way, so link field names now are too.

* refactor(database): move user_error_message next to the shared tools

The table tools imported it from the MCP services, which is a layer above them.

* fix(database): echo no value for a relative date filter that ignores it

The response showed a value Baserow never stored for modes like today; it now
reports null with a note.

* fix(database): match reused table field names ignoring case and spaces

"email" against an existing "Email" was reported missing, and next_steps led to a
near duplicate field. Also tests a blank primary field name over MCP.

* fix(mcp): let list_tables and get_table_schema ignore unknown arguments

They are legacy default tools and ignored extra keys before, so existing
clients that send them got errors.

* fix(database): lock field updates in table and field id order

Two calls locking the same fields in opposite order could deadlock when waiting
for locks instead of failing with a conflict.

* fix(assistant): drop models cached in a failed formula repair

The repair savepoints could leave the request's table model ahead of the
database, like the shared loops did before.

* fix(database): lock all updated fields up front and apply them in order

Sorting the updates broke a rename followed by a formula using the new name; the
fields are now locked in id order first, and a lock conflict reads like REST's.

* fix(database): make gte and lte view filters include equal values

The aliases mapped to strict comparisons, so a row equal to the value was left out.

* fix(database): skip link_row view filters without a row id

A missing or non-numeric value was stored and matched every row.

* fix(database): skip number view filters without a number

A missing value was stored as "None", which hides every row.

* fix(database): use UTC in date view filters when the profile has no timezone

The filter stored "None" as its timezone and matched no rows.

* fix(database): limit view names in create_views to 255 characters

A longer name reached the database column and failed as an internal error.

* fix(database): reject select options that share a value on create

Tools pick options by value, so the second of two such options could never be
matched. update_fields already rejected them.

* fix(database): match a reused lookup's link field name like creation does

Creation ignores case and outer spaces after an exact match, so the reused table
check reported a lookup through "projects" as wrong when its link is "Projects".

* fix(database): only skip a requested field named exactly like the primary field

Field names are unique only when they match exactly, so a requested " Name " next
to the primary "Name" was dropped without a word.

* fix(database): reject a table name several tables in the database share

Table creation reused the last such table while a link picked the first, so the
link could point at another table than the response reported.

* fix(database): create lookups after every requested table has its fields

Fields were added table by table, so a lookup of a field in a later table of the
same create_tables call failed.

* fix(database): skip a requested field named like the primary in another case

Clients vary the case of the primary field name, so an exact match created a
second "name" next to "Name". Spaces still count, as on develop.

* fix(database): resolve linked table names among the tables the user can see

A hidden table of the same name made a link ambiguous, and the error revealed it.

* fix(database): store an empty value for empty and not empty number filters

* docs(mcp): list_applications lists databases only

* test(assistant): add formula and lookup evals for Kuma's database tools

* test(assistant): expect an empty value for empty number filters

* feat(database): look up through the table's only link field when none is named

Kuma often leaves the link out of a lookup and retries after the validation error.

* fix(assistant): keep a later formula update and stop repairing formulas when cancelled

* fix(database): take the filter timezone from the tool context, not the user profile

An actor such as an Agent has no profile.

* docs(database): explain a lookup to a formula of a later table

* fix(assistant): repair the formula of the update that failed

Formula errors from update_fields carry the index of their update, so the
repair no longer matches on formula text. A later update that sets the formula
to None leaves it unchanged and no longer skips the repair.
2026-10-23 15:54:16 +00:00
..
2026-06-09 15:41:31 +00:00
2025-10-08 09:13:38 +02:00