Diff two versions
layerz_diffReturns the semantic diff between two revisions of a model: { from, to, diff: { items: [{ uid, displayName, status, fields? }], branches: [{ id, display_name, status?, items }], metadata: [...], summary: { added, removed, modified, branches } } }. items compares the base plan; branches lists, per branch, the overlay cells it records over the base (null where the base shows through): a write under branch_id or an import on a branch appears there, not as a base change. from and to each take exactly one of revision_id, version_number or id; without to, the diff runs against the live model. sources carries the delta of the source settings and bindings (sources[] { id, display_name, status, fields[] }) and of the mapping rules (rules { added, removed, changed }), present when both endpoints carry that state. values: true adds values, the computed-values diff: { granularity, scope, tolerance, computable, items: [{ uid, display_name, status?, changed, cells: [{ period, before, after, delta }] }], summary: { items_compared, items_changed, cells_changed, max_abs_delta, truncated } } — the periods whose value moved beyond tolerance, on the lines uids names, else the key lines (checks, totals), else every value line; computed on the base plan or under branch_id, at granularity. computable: false with errors per endpoint when a revision cannot be computed. source (in place of from): the live model against its source workbook recalculated.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "layerz_diff"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | No | Newer endpoint; omitted = the current live model. | |
| from | No | Older endpoint: exactly one of revision_id / version_number / id. Required unless `source`. | |
| uids | No | With `values`: the lines compared (default: checks and totals). With `source`: the lines compared (default: every linked line). | |
| source | No | Compares the live model (base plan or `branch_id`) with the workbook it was imported from, recalculated by the Excel engine with the cells of `set` overridden (a scenario; none = as saved). Lines: the ones the import linked to their cells, `uids` restricts them, `refs` links rebuilt ones. Each listed line (gaps only, 50 at most, largest first) carries `cells`, `compared`, `off` and `first_gaps: [{ period, source, model, delta }]`; `summary` counts every line (`score`: the share of cells reproduced, `lines_compared`, `lines_matching`, `cells_compared`, `cells_off`, `max_abs_delta`); `unlinked` names the asked uids with no source cells. | |
| values | No | Adds the computed-values diff of the two revisions under `values` (the numbers, not the formulas). | |
| model_id | No | Target model UUID. Required for user-scoped API keys; validated against the bound model for model-scoped keys. | |
| branch_id | No | With `values`: the branch whose `[base, branch]` checkout both revisions are computed under; with `source`: the branch the model is computed on. Absent = the base plan. | |
| tolerance | No | With `values` or `source`: absolute difference above which a cell counts as changed (default 0.01). | |
| granularity | No | With `values`: the dated grain of the comparison; `native` (default) = the finest active grain. |