Skip to main content
Glama

Set data validation

set_data_validation
DestructiveIdempotent

Set or clear data-validation rules on a Google Sheets range to restrict entries, create dropdowns, or show input warnings. Overwrites prior rules.

Instructions

Sets — or clears — a data-validation rule on a grid range. With condition_type set, every cell in the range gets the rule: ONE_OF_LIST with condition_values plus show_custom_ui=true is the classic in-cell dropdown; ONE_OF_RANGE takes a "=Sheet1!A1:A10" formula; NUMBER_/TEXT_/DATE_ conditions restrict input; CUSTOM_FORMULA takes a formula evaluated per cell. strict=true rejects invalid input outright, strict=false only shows a warning; input_message is the help text shown on the cell. OMIT condition_type (and the other rule fields) to REMOVE validation from the range. Overwrites any previous rule on the range — one rule per cell.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
rangeYesCell rectangle in grid coordinates: rows 1-10 × columns A-B = {start_row_index:0, end_row_index:10, start_column_index:0, end_column_index:2}.
strictNotrue rejects invalid input; false (default) shows a warning.
input_messageNoHelp text shown when the cell is selected.
condition_typeNoSheets API condition type, e.g. ONE_OF_LIST, ONE_OF_RANGE, NUMBER_GREATER, NUMBER_LESS, NUMBER_BETWEEN, NUMBER_EQ, TEXT_CONTAINS, TEXT_STARTS_WITH, TEXT_EQ, TEXT_IS_EMAIL, DATE_AFTER, DATE_BEFORE, DATE_BETWEEN, DATE_IS_VALID, BLANK, NOT_BLANK, BOOLEAN, CUSTOM_FORMULA.
show_custom_uiNoShow a dropdown UI for ONE_OF_LIST / ONE_OF_RANGE conditions.
spreadsheet_idYesThe spreadsheet id — the long id from the URL (docs.google.com/spreadsheets/d/<spreadsheetId>/edit) or from create_spreadsheet / search_spreadsheets output.
condition_valuesNoCondition arguments: list items for ONE_OF_LIST (["Yes","No"]), one number for NUMBER_GREATER (["100"]), two for NUMBER_BETWEEN, "=A1>B1"-style formula for CUSTOM_FORMULA and ONE_OF_RANGE ("=Sheet1!A1:A10"), relative dates as values. Omit for BLANK / NOT_BLANK / DATE_IS_VALID.
Behavior5/5

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

Beyond the annotations, the description discloses key behaviors: OMIT condition_type removes validation, overwrites any previous rule, one rule per cell, strict=true rejects vs false warns, and input_message provides help text. This is substantial behavioral context and aligns with destructiveHint=true.

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?

The description is dense but every sentence contributes operational value: setting, clearing, dropdown behavior, strict mode, input message, and overwrite semantics. The core set/clear behavior is front-loaded, with no filler.

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 the rich schema, nested range object, and annotations, the description covers all decisions an agent needs: how to configure a rule, when to omit fields to clear, what strict does, and what gets overwritten. No output schema is needed for a mutation tool whose success response is standard.

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

Parameters5/5

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

Although schema coverage is 100%, the description adds significant meaning: ONE_OF_LIST plus show_custom_ui=true creates the dropdown, ONE_OF_RANGE takes a formula reference, CUSTOM_FORMULA is evaluated per cell, and condition_values shapes are explained with examples. This goes well beyond the raw 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?

The description states a specific action ('Sets — or clears — a data-validation rule on a grid range') and names the exact resource and scope. It clearly distinguishes itself from formatting, conditional formats, and sheet-management siblings by focusing entirely on data validation rules.

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?

The description explains when to use different condition types and how to clear validation, which gives actionable usage guidance. It doesn't explicitly name alternatives, but no sibling tool covers data validation, so the omission is minor.

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/A1-x-Tech/mcp-google-sheets'

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