sheets_create_spreadsheet
Google Sheets write medium risk
Part of the Google Sheets Agent.
What it does
Creates a new, empty Google Sheets spreadsheet owned by the authorizing client (the file is created under the client's Drive via their delegated OAuth grant). Use this to provision a fresh, client-ready destination before writing report data. Key inputs: `title` (the spreadsheet name shown to the client; a title or tab name with Claude, MCP or Anthropic as a whole word is refused before any preview_id - Scalix policy, white_label_required), optional `locale` (e.g. 'en_US') and `time_zone` (IANA, e.g. 'America/New_York') so numbers/dates render correctly for the client, and optional `sheet_titles` to pre-create named tabs. Returns Google's new `spreadsheetId`, the shareable `spreadsheetUrl` (the canonical edit URL to hand to the client) and the created tabs (`sheets[].properties` with `sheetId` and `title`). `applied` shows the spreadsheet_id and the title, locale, time zone and tabs Google actually applied, with a warning where one differs from the request - Google does not reject an unknown time zone, it uses Etc/GMT. Does NOT write any data - pair with sheets_write_values / sheets_append_rows, or use the one-call sheets_export_report path. Response shape: success {success:true,data:{applied,result}} where result is Google's {spreadsheetId,spreadsheetUrl,properties,sheets:[{properties:{sheetId,title}}]}; error {success:false,error_class,message,action_required,is_retryable}. Two-phase (ADR-028/029, the same gate as Google Ads, LinkedIn and CRM writes): the first call (no preview_id) builds the request locally and returns a preview_id - nothing is created or written; re-call with that preview_id and identical arguments to COMMIT (single-use, 30 min; a changed, forged or replayed token fails closed).
When to use it
Use when no suitable destination spreadsheet exists yet and the client needs a brand-new, white-label file to receive a report. If a target spreadsheet already exists, reuse it via sheets_write_values/sheets_append_rows instead of creating duplicates. Prefer sheets_export_report to create-or-reuse a file and write a report's rows in one call (rows only, no formatting).
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
title | string | yes | Spreadsheet name shown to the client. White-label (Scalix policy): 'Claude', 'MCP', 'Anthropic' or 'Scalix' as a whole word, in any case, is refused before any preview_id (white_label_required); inside a longer word (McPherson, Claudette) it is not. |
locale | string | no | Spreadsheet locale, e.g. 'en_US', 'en_GB'. Drives default number/date parsing and display. If omitted, Google applies its own default (en_US in testing), not the Google account's locale - pass it for client reports. |
time_zone | string | no | IANA time zone for date/time rendering, e.g. 'America/New_York'. If omitted, Google applies its own default (Etc/GMT in testing), not the Google account's time zone - pass it for client reports. Google does not reject an unknown zone: it uses Etc/GMT, and the result then carries a warning. |
sheet_titles | array<string> | no | Optional tab names to pre-create, e.g. ['Performance','Notes'] (a single name may be a plain string). Must be unique; each is checked for white-label words like title. If omitted, one default sheet ('Sheet1') is created. |
preview_id | string | no | Omit it to preview: nothing is applied, and the call returns a preview_id bound to this exact request. Pass it only after the user approves that preview in a later message, with the same arguments (leave out validate_only, and add any confirmation flag the preview names). Single-use, expires in 30 minutes; changed arguments need a fresh preview. |
Safeguards
A change in two steps. The first call previews and changes nothing; Claude shows you the preview and applies it only after you approve, within 30 minutes and with the same arguments. Every applied change goes to the audit log. How changes are approved.
Policy
White-label export only: the title, tab names and all content carry only the authorizing client's branding, never Claude, MCP or Anthropic, nor a Scalix-internal label (Scalix policy: a title or tab name with Claude, MCP or Anthropic as a whole word is refused). The new file is created in and owned by the authorizing client's Drive; Scalix never retains ownership. Provision destinations only for the authorizing client; strict per-account isolation (server-derived tenant context). Data-usage: never seed the sheet with LinkedIn member-derived data; member/lead data may be used ONLY for the authorizing client and ONLY for consented purposes - never to enrich/append/verify profiles, build a cross-account or unaffiliated lead database, or commingle data across clients. Honor deletion on request; member profile data caches <=24h, social activity <=48h.
Reminder
Confirm the destination title and client account with the user before creating a new client-visible file.
Errors
| Error class | Means | What to do | Retry |
|---|---|---|---|
auth_error | Google authorization is missing, the session/token is invalid or expired, or the spreadsheets scope was not granted (401). | Reconnect Google in the Scalix dashboard (the connection requests the spreadsheets scope), then retry. | no |
permission_error | The authorizing Google account is not permitted to create files (403), e.g. org Drive creation policy, Drive disabled, or scope insufficient. | Have the client enable Drive/file creation for this account or use an account with creation rights; do not retry until resolved. | no |
not_found_error | A referenced resource is unavailable (404) - rare on create; typically a stale or revoked account context. | Re-confirm the client account/connection and re-run the connect flow; do not retry blindly. | no |
rate_limit_error | Google Sheets API write quota exceeded (429): 60 write requests/min/user, 300/min/project. | Back off and retry using truncated exponential backoff: min((2^n + random_ms), 64s). | yes |
validation_error | Invalid request body (400), e.g. a malformed or empty title, an invalid locale or duplicate sheet titles (an unknown time_zone is not refused: Google applies Etc/GMT). Platform message is surfaced verbatim. | Correct the offending field (surface the Google error message) and retry. | no |
white_label_required | Scalix policy: title or a sheet_titles entry has Claude, MCP or Anthropic as a whole word (any case). Refused before any preview_id; nothing is created. | Rename it without that word, for example with the client's own name, then call again for a new preview. | no |
outcome_unknown | Google Sheets answered a 5xx (e.g. 500/503) to this write, or the connection timed out or dropped once it was open, so the write may have landed. | Check first: look in the user's Drive for a new file with this title (a second create makes a second file), and start over with a fresh preview only if it is not there. | no |
Edge cases
- Duplicate sheet_titles in one request are rejected (400) - dedupe titles before sending.
- Empty sheet_titles yields a single default 'Sheet1' tab; downstream writes should target a known tab name.
- Idempotency: create is NOT idempotent - re-invoking produces a second file. To avoid orphan duplicates, prefer reuse via sheets_export_report's spreadsheet_id path.
- Scope: the spreadsheets scope reaches every spreadsheet the connected Google account can open, not only the files Scalix creates. Scalix requests no Drive scope, so it cannot list, share or read the permissions of Drive files.
- Each new sheet starts at 1,000 rows x 26 columns; the workbook ceiling is 10,000,000 cells total across all tabs - do not over-provision tabs.
- Retention/consent: never inject LinkedIn member-derived data into the title or pre-created tabs; do not persist member/lead data here.