Add a field to a table of the file
patchwork_add_fieldAdds a plain or calculated field to a FileMaker table in a versioned, reversible change. Refuses duplicates and skips layout placement, so use patchwork_place_field to position it.
Instructions
Add a field to a table. With calc the field is a calculation, otherwise a plain field of the given type. Refused when the field already exists. The result is re-exported, and the version is dropped with an error if the field is missing from it. The field is not put on any layout: use patchwork_place_field for that. Makes a new version; patchwork_undo reverses it.
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>"
},
"name": "patchwork_add_field"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| calc | No | FileMaker formula. When given, the field is a calculation with this formula. | |
| name | Yes | Name of the new field, without the table. | |
| type | No | Data type, or result type of the calculation. Default: Text. | |
| table | Yes | Base table that gets the field. Names come from patchwork_list kind=tables. | |
| comment | No | Comment shown beside the field in Manage Database. | |
| context | No | Table occurrence the calculation is evaluated from. Only with calc. | |
| dry_run | No | Only write the patch file to .patchwork/ and return its path. Nothing is applied, no version is made. | |
| message | No | What this change does, kept in the version log. Default: a short description of the change. | |
| is_global | No | Use global storage: one value for the whole file instead of one per record. |