Add a field to a database table
add_fieldAdds one field to a table of the site's connected Supabase project, the same way as Add field in Xodia's Database view (Content, Database): always optional (the table may have entries already), with a migration file in supabase/migrations/ on the branch. Changes the user's live database at once, outside Xodia's Versions. Refused when the table already has that field, for kinds Xodia doesn't add, and for a link to a table with no single ID field. With source "xodia" (or when get_project database.source is "xodia") it works on the site's own Xodia database, whose tables and rules are the file xodia/data-rules.json in the repo: it adds the field to that file and sends it to the test data, like create_table. No tool deletes or renames a table or field, deletes entries, or runs SQL: the owner does that in Xodia's Database view (Content, Database).
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"table": "<table>",
"name": "<name>",
"kind": "<kind>",
"projectId": "<projectId>"
},
"name": "add_field"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| kind | Yes | The kind of field: "text" (Text), "number" (Number), "yes_no" (Yes or no), "date" (Date), "date_time" (Date and time), "link" (Link to another table) | |
| name | Yes | The field's name: letters, numbers, spaces and underscores, starting with a letter (it is stored lower case with underscores: "Guest count" becomes guest_count) | |
| table | Yes | The table's name as list_tables gives it (bookings) | |
| branch | No | Optional branch for the migration file; default the branch the workspace has open | |
| linkTo | No | For kind "link": the table it points at (its single ID field is used) | |
| source | No | Which database: "xodia" (the site's own Xodia database, kept by Xodia) or "supabase" (the Supabase project the owner connected). Leave out to use the one get_project database.source names | |
| projectId | Yes | Project id from list_projects |