Skip to main content
Glama

add_sheet_data_validation

Apply data-validation rules (dropdowns, number bounds, custom formulas) to a Google Sheets range. Replaces existing validation to enforce input constraints.

Instructions

Apply a data-validation rule to a range (dropdowns, bounds, formulas).

Side effects: replaces any existing validation on the range. For conditional formatting (color rules) use manage_conditional_formatting. For protecting cells from edits use protect_sheet_range. Requires the spreadsheets OAuth scope.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
user_google_emailYesThe user's Google email address (authenticated account).
spreadsheet_idYesTarget spreadsheet ID.
range_nameYesA1 range, e.g. "Sheet1!A1:A10" or "A1:A10".
validation_typeYesONE_OF_LIST, NUMBER_BETWEEN, NUMBER_GREATER, NUMBER_LESS, NUMBER_EQ, TEXT_CONTAINS, TEXT_EQ, DATE_AFTER, DATE_BEFORE, DATE_ON_OR_AFTER, DATE_ON_OR_BEFORE, CUSTOM_FORMULA, or BOOLEAN.
valuesNoFor ONE_OF_LIST: allowed dropdown options. For NUMBER_BETWEEN: [min, max]. For single-value conditions: [value]. Ignored for BOOLEAN and CUSTOM_FORMULA.
custom_formulaNoFor CUSTOM_FORMULA only — an expression returning TRUE to allow, e.g. "=A1>0" or "=REGEXMATCH(A1,"^\d+$")".
strictNoTrue rejects invalid input outright. False shows a warning but accepts the entry.
show_dropdownNoFor ONE_OF_LIST — True (default) renders the dropdown arrow; False hides it while still enforcing the rule.
input_messageNoOptional help text shown when the cell is focused.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

Discloses the key side effect: 'replaces any existing validation on the range.' Without annotations, this is critical. Could mention more edge cases or performance, but sufficient.

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 concise sentences: first states purpose, second adds side effect, third provides alternatives and auth requirement. No unnecessary words, front-loaded.

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

Completeness4/5

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

Covers purpose, side effect, alternatives, and auth. Output schema exists, so return values are handled. Minor gaps in edge-case behavior, but overall complete for usage.

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

Parameters3/5

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

Schema description coverage is 100%, so parameters are well-documented. The description adds only a high-level summary (dropdowns, bounds, formulas), not enhancing individual parameter meaning.

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?

The description clearly states the verb 'Apply' and the resource 'data-validation rule to a range', with examples (dropdowns, bounds, formulas). It distinguishes itself from sibling tools like manage_conditional_formatting and protect_sheet_range.

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

Usage Guidelines5/5

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

Explicitly tells when to use this tool (for data validation) and when not (conditional formatting -> manage_conditional_formatting, cell protection -> protect_sheet_range). Also notes the required OAuth scope.

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