layerz_build_from_blueprint
ChatGPTBuilds or extends a model from a strict Blueprint (whole sections with their hierarchy, items referenced by name), or applies a stored template as a module through template_id (mutually exclusive with blueprint, loaded server-side). mode: 'merge' (default) adds to the model, reusing items by name and keeping the presentation fields a re-declared item omits; mode: 'replace' rebuilds the whole model (structure, timelines, values, branches), keeping style colours, custom formats, locale, glyph, subtitle and FINANCE.md. dry_run: true validates and returns errors with their path without writing. Persists one version labelled with summary. Not advertised to read-only keys.
layerz_create_model
ChatGPTCreates a model and returns its detail with its UUID, in workspace_id (a workspace the caller belongs to; default the personal one) where every member of that workspace edits it. template_id copies a template (official, or from the library of a workspace the caller belongs to) into the new model with its sources, staged transactions and mapping rules under fresh ids (connector credentials excluded); the template itself is unchanged, timelines sets its bounds, glyph its emblem (a kebab-case Lucide icon name, e.g. SaaS trending-up, banking landmark, real estate house, coffee shop coffee, energy wind, HR users, valuation scale, treasury wallet). Rejected past the plan model cap. Not advertised to model-scoped or read-only keys.
layerz_create_upload_url
ChatGPTIssues a 24h signed Storage URL for an Excel/CSV file and returns file_id, signed_url, expires_at. signed_url accepts an HTTP PUT of the file body with the declared content type (a shell curl -X PUT --data-binary @file; the binary stays out of the conversation); file_id is the identifier the file-consuming tools take. Limits: 25 MB, MIME whitelist (xlsx, xls, csv, json, txt). Mints no model data, so it stays available to read-only keys.
layerz_delete_branch
ChatGPTDeletes a branch, every input row tagged with its dataset_id, and the data sources that fed only that branch (their staged transactions with them); a source shared with another branch is detached instead. The default branch is rejected. Returns deleted_dataset_id, inputs_removed, sources_removed. Persists one version labelled with summary. Not advertised to read-only keys.
layerz_dependencies
ChatGPTReturns an item's dependency graph, like Excel trace precedents / dependents: precedents (items its formula references) and dependents (items referencing it). depth (1–5) walks transitively, direction restricts to one side.
layerz_diff
ChatGPTReturns 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 (value / values / timeline_values, 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 and 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 evaluated.
layerz_export
ChatGPTGenerates a file from a model and returns { download_url, filename, size, file_id, expires_at }. target: 'model' (default) is the Excel workbook (the same export as the web app: Intro + per-section sheets, native charts and dashboards, live formulas), plus structure_hash / values_hash; when the model has branches, the statements and single-value widgets follow branch_id (default: the base branch) while dashboards keep every branch they break down by. target: 'transactions' is the full staged import of the data source source_id as a CSV file (no filters, no routing annotations), plus row_count. Each call persists a new private file in Storage, where the file and its signed download_url expire after 24h; the model itself is not modified, so the tool stays available to read-only keys, off quota.
layerz_external_ref
ChatGPTManages the links from this model to items of other Layerz models (an external ref, like an Excel linked workbook), by op. link: creates (or retargets, with uid) a non-list assumption whose values hold a snapshot of the source item's computed series projected to this model's grain (null outside the source's coverage); requires read access to the source model; the line is referenceable in formulas like any assumption; up to 200 links in links (one form per call) load each source once, are validated whole (one failure writes nothing) and return results. refresh: re-reads every linked source (or uids) and rewrites the snapshots, the only way the values move; a per-link failure (source or item gone) leaves the stored values intact; when values change, the pre-refresh state is snapshotted first (Auto-backup before refresh). unlink: detaches the line uid, keeping its values as an ordinary assumption. A self-link is rejected; a cross-model cycle resolves one hop per refresh. Link status and staleness: layerz_list_integrations { include_external_refs: true }. Persists one version labelled with summary. Not advertised to read-only keys.
layerz_get_conventions
ChatGPTReturns the conventions the tools' values are expressed in: custom_instructions (the conventions of a workspace, the standing instructions for AI agents its members share, ≤ 3000 chars, empty string when unset; also delivered in the handshake instructions), workspace ({ id, name, kind }: the targeted model's workspace when the caller is a member of it, else workspace_id, else the personal workspace) and, when a model is targeted, finance_md (the model's FINANCE.md: raw Markdown, source, spec_version, parsed front_matter with currency / units / sign convention / glossary, validation_errors; null when the model has none). include_guide: true adds guide, the modeling guide (session workflow, structure, stock-flow, lists, branches, sources, templates, checks, versions; also the resource modeling-guide://reference).
layerz_get_model
ChatGPTReturns the full detail of a model: items, lists, timelines, custom formats, number_locale, glyph, revision_id (sha256 fingerprint) and version_number, plus branches[] (id, display_name, priority, actuals_through, actuals_through_locked) and sharing with the roster (members[]: owner, collaborators and pending invites with their roles and ids, is_owner, link_visibility: invite = sign-in required, public = anyone with the link reads it). Larger payload than layerz_read, which returns a filtered snapshot.
layerz_history
ChatGPTReturns the version history of a model, newest first: { current_revision_id, current_version_number, history_days, hidden_count, oldest_hidden_at, pinned_count, max_pinned_versions, versions: [{ revision_id, version_number, created_at, trigger_type, actor_user_id, label, conversation_id, pinned }] }. Each version is a full snapshot persisted at one mutation boundary; revision_id (sha256 of the snapshot) is stable while the model is unchanged. Versions older than the plan window are counted in hidden_count but not listed; pinned versions stay listed whatever their age. limit and since scope the list. With uid, returns instead that item's change events across the history: { uid, events: [{ revision_id, version_number, created_at, actor_user_id, trigger_type, status: added | removed | modified, fields?: [{ field, oldValue, newValue }], branches?: [{ id, display_name, status, fields? }] }] } — fields describes the base plan, branches the overlay cells a branch records over it (a write under branch_id or an import on a branch lands there, not in fields).
layerz_import_branch
ChatGPTWrites values onto a branch of the model, creating the branch when branch.id names none (branch.display_name required then; branch.actuals_through sets its cutover). Two sources, mutually exclusive: entries[] (one value per item and period; items resolved by item_uid or item_label, created as assumptions when absent; entry_uid / entry_label target one entry of a list-mode item) or file_id (an uploaded spreadsheet parsed server-side, each row classified with the model's mapping rules; sheet_name, structure_override, replace_source_id refine the parse). An entry's timeline_ref equals the target item's grain or constant (any other grain is rejected); on a formula / balance it is a per-period override; on a callup it lands on the source (redirected). A data source is materialized on the file_id path and when record_import is given; bare entries[] write a manual overlay with no source. replace: true (with branch.id) wipes the branch's rows before writing, uncovered periods keeping their prior value; merge: true upserts cell by cell; dry_run: true returns the impact (would_persist: false, overridden_items, validation_errors_new) without persisting. Returns dataset_id, created_items, matched_items, entries_written, inputs_written, inputs_removed, warnings (plus skipped, mapping_drift, file_structure on the file path). Persists one version labelled with summary. Not advertised to read-only keys.
layerz_list_integrations
ChatGPTLists every data source feeding a model: API connectors (Qonto, Pennylane, Stripe, Airtable, Metabase) and file imports (kind csv | fec), each with kind, display_name, branch_ids (the branches it feeds), sync status, last_synced_at and source_fields (the payload fields an API connector's field_map can re-point its description / category / account_number to; null when there is nothing to choose). A row with legacy_import_id is a materialized pre-staging import that owns input rows but staged no transactions. include_external_refs: true adds external_refs: the links to items of other Layerz models, each with a value-aware stale flag (the source moved in a way that changes the snapshot) and its source health. Stored credentials are not returned.
layerz_list_mappings
ChatGPTLists the import classification rules in scope for a model: sets (each with a scope: model = the model's own rules, system_template = the curated country catalogs (PCG, US GAAP, UK, SKR03/04), user_template = the reusable catalogs of the caller's workspaces), mappings (every effective rule: pattern → target item, sign, source scope; total counts them) and templates (the catalogs importable through layerz_manage_mapping { op: "import_template" }). A model classifies with its own model rules only; a catalog applies once imported. A pattern is a case-insensitive glob where * matches anywhere. include_user_mappings: true adds the catalogs of the caller's workspaces to sets / mappings; include_coverage: true adds per-rule match_count and a coverage block (auto-created count, ignored count, the top keys routing nowhere).
layerz_list_models
ChatGPTLists the models the authenticated user can access, and the workspaces they belong to (workspaces[]: id, name, kind personal | team, role admin | member, plan). Each model carries workspace_id, can_write (owner, workspace member or editor guest), url, glyph and sharing: { shared, member_count, link_visibility }. q filters by name (case- and accent-insensitive substring, * wildcard), writable: true keeps owner/editor models only. A model-scoped key gets its bound model only.
layerz_list_templates
ChatGPTLists the model templates the caller can start from: the official templates curated by Layerz and the workspace templates of the caller's workspaces (each workspace's library, read by its members and not by its guests; workspace_id names it). A template is a read-only copy published from a model in the web app; this tool reads it and changes nothing. Each entry carries name, subtitle, glyph, description (the template's FINANCE.md, its usage guide), scope and a structure summary (section names + item count). With template_id, returns that single template in full, blueprint included. A template forks into a new model through layerz_create_model { template_id } and applies as a module through layerz_build_from_blueprint { template_id }.
layerz_list_transactions
ChatGPTReturns a data source's staged transactions (API connector or csv/fec file import) annotated with their routing: the target item and whether a rule or an auto-created item matched, the skip reason otherwise (mapping is the only routing path, no fuzzy match), or ignored for a row an __ignore__ rule routes nowhere on purpose. period (YYYY-MM) and q (substring on description/category) filter the rows. The full staged import as a CSV file is layerz_export { target: 'transactions' }. A materialized legacy import derives one row per owned cell from the model's input rows.
layerz_manage_integration
ChatGPTRuns one operation on a data source (API connector Qonto, Pennylane, Stripe, Airtable, Metabase, or a csv/fec file import) by op. sync: pulls the provider's rows into the bound branch as a replace of this source's own rows (the baseline is untouched); on a file source, replays the projection over the staged rows; target_branch_id lands a still-unbound connection on an existing branch; dry_run: true reports the impact without persisting. rebind: re-points the source at branch_ids, wiping its rows from detached branches and reprojecting into the new ones. update: renames the source (display_name) and/or applies config then replays the projection; a change of import_level or of a tabular mapping (field_map, measures, sign_rule) re-fetches and re-stages, and is rejected on a csv/fec file source. delete: disconnects the source, drops its staged transactions and purges everything it projected into the model (input rows, provenance, import entry); items and the branch are kept, emptied; when the purge would destroy values the source cannot re-project, the call is refused with PURGE_CONFIRMATION_REQUIRED and a purge_preview, and a retry with confirm_purge: true performs it. Every projecting op returns unmapped, proposed_window, deletable_items (reported, not removed), cutover_changes, shadowed, warnings. Credentials stay in the web app. Persists one version labelled with summary. Not advertised to read-only keys.
layerz_manage_mapping
ChatGPTWrites the model's classification rules by op, in its single mapping set (created on first use). set: creates or updates rules identified by (source_id, pattern, secondary_pattern), one rule from the flat fields or up to 500 in rules (one form per call). pattern is a case-insensitive glob where * matches anywhere (Apport*, *641, 601000) tested against the source's primary key; secondary_pattern (default *) against its secondary key; source_id (required) is the data source the rules classify; target is an item name or uid, uid::entryUid for one entry of a list-mode item, or __ignore__ to route matching rows nowhere; sign (natural | negate | absolute) adjusts the amount. The batch is validated whole first (empty pattern, foreign source, target matching no item or several, repeated key): one failure writes nothing. Each rule reports created, updated or unchanged, with totals; a replay writes nothing. delete: removes mapping_id, or every id of mapping_ids (up to 500). import_template: duplicates the rules of the catalog template_id into the model set for source_id, targets translated by item name; a conflicting imported rule overwrites the model's, reported in overwritten. A rule change applies to the projected values on the next layerz_manage_integration { op: "sync" }. Rules are versioned: the call writes a version labelled with summary; a version restore puts them back. Not advertised to read-only keys.
layerz_manage_version
ChatGPTActs on one version of a model (version: exactly one of revision_id, version_number, id) by op. pin: keeps the version listed, diffable and restorable beyond the plan history window; capped per plan (max_pinned_versions, 403 past the cap); a no-op on a pinned version. unpin: frees the slot; a version past the window then stops being listed. restore: replaces the live items, schema and inputs with that snapshot, and puts back the source settings (window, keys, bindings) and the mapping rules as they stood at that version, after saving the current state as a restore backup version (backup_version_id, null when the live state already matched the latest snapshot); requires summary, the label of the restored state. Returns { ok, version_id, version_number, revision_id, pinned, pinned_count, max_pinned_versions } for pin / unpin, { ok, restored_version_id, restored_version_number, restored_revision_id, backup_version_id, sources?: { sources_restored, rules_written, rules_removed }, warnings[] } for restore — warnings names what could not come back (a source deleted since, a rule whose target is gone, a version written before source versioning). The target is inside the plan window or pinned. Not advertised to read-only keys.
layerz_match_items
ChatGPTResolves free-text labels (e.g. row labels of a parsed file) to existing item UIDs of a model: the top 3 candidates per label across exact_uid, exact_name, slug and fuzzy (Levenshtein) methods, each with a score. An empty candidate list means no existing item matched. Deterministic, no LLM call.
layerz_parse_file
ChatGPTParses an uploaded Excel/CSV (file_id) deterministically and returns a token-optimized structure: sheet summaries (without sheet_name) or, for one sheet, the detected timeline, suggested_structure (layout, header row, columns), row labels and column headers with samples. A wide sheet is recognised by its period header: a run of at least three consecutive periods (bare years such as 2026, YYYY-MM, Jan 2026, Q1 2026, date cells) in any column, reported as detected_periods and period_range. A raw DATEV EXTF export and a French FEC (compact YYYYMMDD dates, prior-year opening entries moved into the first month) are detected natively. structure_override re-parses with corrected columns when a ledger is misdetected (a Débit column taken as the value, an account-code column taken as the label) or when a wide sheet has fewer than three period columns (layout: "wide"). The raw binary is not returned.
layerz_patch
ChatGPTApplies a batch of mutations to a model: create, replace, update, delete, move, list_create, list_update, list_delete and meta (name, subtitle, finance_md, timelines, formats, number_locale, default_branch, glyph). The batch is all-or-nothing: a validation failure persists nothing and returns every error at once (MODEL_VALIDATION_ERROR, details[]). A create may carry a temp id later ops reference (parent, source, target, series, liste_ref, after, $_id in a formula); map gives each temp id its UID. replace keeps the item's UID and presentation fields; update is a strict partial merge of the named fields. Root accepts section and dashboard; dashboard accepts widgets only; a formula with both an expression and children is rejected (FORMULA_EXPR_AND_CHILDREN); a list-mode item takes timeline_values, a non-list item value / values (a sparse period-keyed timeline_values map merges into values). branch_id routes the value writes onto that branch as an overlay of the cells differing from the base, with no data source; compute returns the computed series of the given UIDs (under compute_branch, default branch_id); dry_run validates and computes without persisting; compare_values adds value_diff, the numbers the batch moved (the layerz_diff values report). Persists one version labelled with summary. Not advertised to read-only keys. Modeling patterns and examples: resource modeling-guide://reference.
layerz_read
ChatGPTReturns a UID-native snapshot of a model: model (name, timelines, lists, branches), items (flat, parent_uid carries the hierarchy, each with role, formula, check, note) and revision_id / version_number. Filters: uids, roles, include_children. with_values: true adds the computed series v aligned with the periods p (periods for explicit labels of mixed grains, else granularity), variance adds vv, per_element adds ve for list-mode items, health adds the check report, branch_id computes v and health under one branch's [base, branch] checkout instead of the stacked view. The check report is judged on a branch checkout, not the stacked view: without branch_id, a multi-branch model reports the branch it opens on (health.branch_id) and every branch under health.by_branch. When the response leads with computable: false, errors[] names the broken dependencies (e.g. CIRCULAR_DEPENDENCY) and every series is a zero-filled placeholder.
layerz_set_custom_instructions
ChatGPTReplaces the conventions of a workspace (the personal one by default, or workspace_id): the standing instructions for AI agents its members share (plain Markdown/text, ≤ 3000 chars; an empty string clears them). They apply across every model of the workspace, on top of each model's FINANCE.md, and are delivered in the handshake instructions of the next session. Any member may write them. No version is persisted. Not advertised to model-scoped or read-only keys.
layerz_set_finance_md
ChatGPTReplaces the FINANCE.md attached to a model with the given Markdown (YAML front matter + body, ≤ 5,000 chars). source: 'imported' marks content synced from a project-root file, 'user' (default) content authored in place. The content parses as a YAML front-matter document; schema warnings are returned without blocking. A template is a read-only published copy and is out of this tool's reach; a model's FINANCE.md becomes a template's usage guide when the model is published from the web app. Persists one version labelled with summary. Not advertised to read-only keys.
layerz_share_model
ChatGPTChanges who can access a model, by op. invite (default): grants email the role viewer (read-only, default) or editor; a registered user gets an active share, an unregistered one a pending invite; both receive an email. revoke: removes the collaborator or pending invite principal_id (an id from the sharing.members of layerz_get_model). Owner-only. The link visibility (invite / public) is changed by the owner in the web app only. No version is persisted. Not advertised to read-only keys.
layerz_update_branch
ChatGPTCreates or updates a branch. With dataset_id, patches that branch's metadata (display_name, priority, source_hint, file_name, actuals_through). Without it, the branch named patch.display_name is updated when it exists and created otherwise, with no data source and no input rows (values are then written with layerz_patch { branch_id }). priority is rejected on the default branch. An explicit actuals_through pins the real/forecast cutover (actuals_through_locked: true: source syncs stop rewriting it); null resets it to auto. Returns { branch, created }. Persists one version labelled with summary. Not advertised to read-only keys.
layerz_validate_model
ChatGPTRuns the core model validator (structural / formula / timeline checks) without writing and returns { ok, error_count, warning_count, errors[], warnings[] }; each issue carries a code (e.g. UNKNOWN_UID, CIRCULAR_DEPENDENCY, INVALID_ROLE_CHILD, TIMELINE_MISMATCH), a message and item_uids. The write path auto-repairs some of these issues and enforces a few invariants this audit skips, so ok: true is a sanity signal rather than a write guarantee.