set_worksheet_protection
Protect or unprotect a worksheet to restrict user edits, optionally with a password, ensuring locked cells remain unchanged.
Instructions
Protect or unprotect a worksheet. Protection restricts user edits; cells formatted as locked are affected.
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": {
"sheetName": "<sheetName>",
"protect": "<protect>"
},
"name": "set_worksheet_protection"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| protect | Yes | True to protect, false to unprotect. | |
| password | No | Optional password for the protection. | |
| sheetName | Yes | Worksheet name. | |
| workbookId | No | Target workbook ID from list_workbooks. Optional when only one workbook is connected. |