create_bsheet
Create a new native input sheet in a model, with optional starter tabs containing literal rows and an optional model attachment, and commit its canonical .bsheet.json document atomically. Always creates purpose=‘input’ – output sheet views are generated separately, not created through this tool. sheet_id is generated by the server; you cannot choose one.
changes state
Parameters
Section titled “Parameters”| Name | Type | Required | Default | Description |
|---|---|---|---|---|
model_name |
string |
Yes | — | Name of the Bridge Town model to attach the new sheet to. |
name |
string |
No | None |
Display name for the new sheet. Required for a blank sheet; with source_sheet_id it defaults to ‘ |
source_sheet_id |
string |
No | None |
Optional sheet_id of an output sheet view to copy into the new editable input sheet, as returned by list_bsheets or create_bsheet_output_view. The source view is left untouched; non-empty cells carry over as sparse cells. Omit to create a blank or literal-table sheet. Cannot be combined with tabs, attached_model, currency, or locale. |
source_branch |
string |
No | None |
With source_sheet_id: branch of the output view’s cached row to copy, when the sheet exists on more than one branch. Defaults to branch, and if branch is also omitted, resolves to the sheet’s default/unresolved-branch row – never the most-recently-updated row across branches. Independent of branch, which only controls where the new input sheet is committed. |
attached_model |
string |
No | None |
Optional stable Bridge Town model name associated with this sheet. Input documents may retain a repository-relative entrypoint path; public Native Sheet responses expose that path as its model name. Recorded for lineage only – not validated against the model’s contract. |
currency |
string |
No | None |
Optional active ISO 4217 override; defaults to the model currency. |
locale |
string |
No | None |
Optional supported display-locale override; defaults to the model. |
tabs |
list of object |
No | None |
Optional tabs, up to 25. Each item may set name (str), row_count (int), column_count (int), and rows (non-empty rectangular list of literal scalar values or nulls). Supplying rows creates an editable sparse input tab in the same atomic commit; blank positions remain explicit. A supplied table must fit the 40,000-cell sheet limit and match any declared dimensions. Without rows, the tab is created empty (defaults: 100x26). When omitted, one empty tab named ‘Sheet1’ (100x26) is created. Native Sheet documents are limited to 4 MiB; MCP requests retain their 1 MiB transport limit. |
branch |
string |
No | None |
Branch to commit the new sheet to. Defaults to the model’s default branch when omitted or null; with source_sheet_id it defaults to the source output view’s branch and never selects the source row (see source_branch). |
commit_message |
string |
No | '' |
Git commit message. If omitted, the server generates a default message. |
response_detail |
one of: auto, receipt, full |
No | 'auto' |
|
workspace_id |
string |
No | None |
Returns
Section titled “Returns”Returns a structured object. Top-level fields:
model_name(string)sheet_id(string)name(string)purpose(string)attached_model(string)branch(null)commit_sha(string)sha(string)tab_count(integer)row_count(integer)column_count(integer)cell_count(integer)response_detail(string)tabs(array<object>)calculation_status(string)
See the response example below for the full payload shape.
Example
Section titled “Example”Tool Call
Section titled “Tool Call”{ "name": "create_bsheet", "arguments": { "model_name": "forecasts", "name": "Revenue Assumptions", "attached_model": "revenue", "response_detail": "auto", "tabs": [ { "name": "Inputs", "row_count": 100, "column_count": 26 } ] }}Response
Section titled “Response”{ "model_name": "forecasts", "sheet_id": "sht_1a2b3c4d5e6f7890a1b2c3d4e5f67890", "name": "Revenue Assumptions", "purpose": "input", "attached_model": "revenue", "branch": null, "commit_sha": "abc1234def5678901234567890abcdef12345678", "sha": "abc1234def5678901234567890abcdef12345678", "tab_count": 1, "row_count": 100, "column_count": 26, "cell_count": 0, "response_detail": "full", "tabs": [ { "tab_id": "tab_2b3c4d5e6f7890a1b2c3d4e5f6789012", "name": "Inputs", "row_count": 100, "column_count": 26, "cell_count": 0, "cell_encoding": "sparse", "cells": {}, "rows": [], "formatting": { "column_widths": {}, "row_heights": {}, "frozen_rows": 0, "frozen_columns": 0, "show_gridlines": true } } ], "calculation_status": "clean"}Copying an output view into an editable sheet
Section titled “Copying an output view into an editable sheet”Output sheet views are immutable. To edit their numbers, pass
source_sheet_id to copy the view into a new input sheet. The source view is
left untouched, non-empty cells carry over as sparse cells, and name
defaults to <source name> (input copy). tabs, attached_model,
currency, and locale cannot be combined with source_sheet_id.
{ "model_name": "forecasts", "source_sheet_id": "sht_7890a1b2c3d4e5f67890a1b2c3d4e5f6", "name": "Q1 Output (editable copy)"}The copy returns a compact receipt: the new sheet’s identity plus
source_sheet_id, source_branch, source_commit_sha, source_sha,
branch_ref, provenance_source: "duplicate", per-tab tab_id, name,
row_count, column_count, and cell_count, and a bounded get_bsheet
call in follow_up for reading the copied cells. Pass
response_detail: "full" to receive the cells instead; an oversized request
is rejected before anything is written.
- Module:
BSheets - Requires an authenticated Bridge Town session (OAuth) or an API token.