Skip to main content
Glama

protect_sheet_range

Restrict editing of a spreadsheet range by setting a protected range. Choose strict blocking or a warning dialog to prevent unauthorized changes to sensitive cells.

Instructions

Protect a range in a spreadsheet so unauthorized users cannot edit it.

Adds a Sheets "Protected range" entry (Data > Protect sheets and ranges) restricting who can modify the cells. Two enforcement modes: strict (non-editors are blocked) or warning-only (a confirmation dialog appears, but edits are allowed). Use strict for financial data, formula cells, or anything where an accidental overwrite would corrupt downstream calcs.

Requires OAuth scope: https://www.googleapis.com/auth/spreadsheets (write). Protection does NOT prevent the owner or anyone with file-level "Editor" permission on the Drive file from bypassing via the Sheets UI — it only gates in-cell edits. For hard access control, use Drive sharing.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
user_google_emailYes
spreadsheet_idYesGoogle Sheets spreadsheet ID (from the URL after `/d/`).
range_nameYesA1-notation range to protect, e.g., `"Sheet1!A1:D10"`, `"Summary!B:B"` (entire column), `"'My Sheet'!A1:Z100"` (sheet name with spaces). To protect an entire sheet, use `manage_sheet_tabs` or pass the full sheet range (`Sheet1!A1:ZZ1000000`).
descriptionNoHuman-readable note shown in the Protected ranges sidebar (e.g., "Formulas — do not edit"). Omit for no description.
editor_emailsNoList of Google account email addresses allowed to edit this range. Omit (or pass `None`) to restrict edits to the spreadsheet owner only. Editors must already have access to the file at the Drive level; adding emails here does not share the file.
warning_onlyNoWhen `True`, edits are allowed after a "Are you sure?" confirmation dialog (suitable for nudging users). When `False` (default), edits are strictly blocked for non-editors.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, so description carries full burden. It discloses required OAuth scope, the two enforcement modes, limitation about bypassing, and that it's a UI-level protection. Missing potential error handling or permissions details, but covers key traits.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three well-organized paragraphs: purpose/modes, usage advice, scope and limitations. No fluff, every sentence adds value. Front-loaded with core action.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given output schema exists, description does not need return details. It covers purpose, modes, limitations, and scope adequately for a protection tool. No gaps observed.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 83%, and description adds meaningful context for parameters: explains warning_only behavior, range name examples, editor_emails access requirement. Only user_google_email lacks added context. Adds value beyond schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description clearly states verb 'protect a range' and resource 'spreadsheet', specifies it adds a 'Protected range' entry, and distinguishes from sibling tools like manage_sheet_tabs (sheet-level) and format_sheet_range (formatting).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides context for using strict vs warning-only modes, and warns that protection does not block owners/editors via UI, recommending Drive sharing for hard control. Lacks explicit when-not-to-use but offers clear guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/HuntsDesk/ve-gws'

If you have feedback or need assistance with the MCP directory API, please join our Discord server