Set rules
set_rulesDefine workbook validation rules that are checked on each value-changing write; passing rules that later fail trigger rollback, while existing failures never block edits.
Instructions
Replace the workbook's rules and check them once; later value-changing writes are checked automatically.
A write that makes a passing rule fail (or a failing one worse) is rolled back; rules already failing never block. Stored as ".rules.json". Each rule has an "id" plus one of: {"type": "cells_equal", "left": "S!B40", "right": "S!C40", "tolerance": 0.01} {"type": "cell_compare", "cell": "S!D4", "op": "<=", "value": 1000} (or "cell_ref") {"type": "column_check", "sheet": "Data", "expr": "Qty >= 0", "cell_range": "A1:F500"} {"type": "column_unique", "sheet": "Data", "column": "Invoice"} {"type": "not_empty", "range": "Data!A2:A500"} {"type": "no_new_errors"}
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": {
"rules": "<rules>"
},
"name": "set_rules"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | No | File path or preloaded name (list_configured_files). Omit if only one file is preloaded. | |
| rules | Yes | Rule objects, each with a unique id and a type (see tool description). An empty list removes all rules. | |
| on_violation | No | "rollback": undo a write that breaks a rule. "warn": keep it and report. | rollback |
| on_unverifiable | No | What to do when a rule cannot be checked (e.g. LibreOffice missing): "warn" or "rollback". | warn |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||