manage_db_fields
Add or remove fields (columns) in a SiYuan database, including relation and rollup fields, by specifying the database ID, field type, and action.
Instructions
Add or remove fields (columns) in a database. Renaming is not supported by SiYuan API — use the GUI.
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": {
"avId": "<avId>",
"action": "<action>"
},
"name": "manage_db_fields"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| avId | Yes | Database ID | |
| name | No | Field name (required for add) | |
| type | No | Field type (required for add) | |
| action | Yes | "add" to create a field, "remove" to delete one | |
| rollup | No | Required when adding a rollup field | |
| fieldId | No | Field ID to remove (required for remove) | |
| relation | No | Required when adding a relation field |