apply_table_patch
Preview and commit keyed table updates to existing Excel rows against a pinned base, blocking conflicts, missing rows, or changed premises before writing.
Instructions
Preview/commit a three-way keyed patch against a pinned retained base.
patch requires version=1, source={table_name, optional sheet_name}, nonempty
key_fields, explicit read_fields (use [] only for no extra dependencies), and
updates=[{key: {all key fields}, values: {literal field updates}}]. Write fields
must not be keys/read_fields. Checks complete unique keys and row-local read
dependencies; does not infer undeclared or cross-row dependencies. Existing
rows only, same exact headers with reordering allowed, no formula evaluation.
Numeric keys/read/target values use exact typed equality, never rounded decimal
spelling: int10**23 differs from float1e23, but numeric1 equals1.0.
Conflicts/missing rows/changed premises block the entire batch. Commit requires
the identical patch/base and rebase_token/expected_workbook_sha256 from a fresh
preview. Reuses ChangeSet snapshots, exact-file checks and rollback. Limits:
1000 target cells, 50 contiguous column spans, 50000 table cells/64 columns per
source; sample_limit 1-10 bounds examples only. Tokens are not authentication.
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": {
"base_filepath": "<base_filepath>",
"filepath": "<filepath>",
"patch": "<patch>",
"expected_base_sha256": "<expected_base_sha256>"
},
"name": "apply_table_patch"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | preview | |
| patch | Yes | ||
| filepath | Yes | Reuse supplied server path; NEVER prepend client cwd. Rooted: relative OK; unrooted stdio: absolute, ask if missing. | |
| rebase_token | No | ||
| sample_limit | No | ||
| base_filepath | Yes | Reuse supplied server path; NEVER prepend client cwd. Rooted: relative OK; unrooted stdio: absolute, ask if missing. | |
| expected_base_sha256 | Yes | ||
| expected_workbook_sha256 | No |