Add Field
add_fieldAdd a new attribute field to a QGIS vector layer, specifying field name, type, and optional length or precision for structured data storage.
Instructions
Add a new field to a vector layer. field_type: 'string', 'int', 'double', 'bool', 'date', 'datetime'.
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": {
"layer_id": "<layer_id>",
"field_name": "<field_name>",
"field_type": "<field_type>"
},
"name": "add_field"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| length | No | ||
| layer_id | Yes | ||
| precision | No | ||
| field_name | Yes | ||
| field_type | Yes |