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

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. Changed9 schema fields changedv1.0.0
    • changedInput schema / properties / custom_formula / description
      Previous value: -"For CUSTOM_FORMULA type, the formula (e.g., \"=A1>0\")."New value: +"For CUSTOM_FORMULA only — an expression returning\nTRUE to allow, e.g. \"=A1>0\" or \"=REGEXMATCH(A1,\"^\\d+$\")\"."
    • changedInput schema / properties / input_message / description
      Previous value: -"Optional help text shown on hover."New value: +"Optional help text shown when the cell is\nfocused."
    • changedInput schema / properties / range_name / description
      Previous value: -"A1 range (e.g., \"Sheet1!A1:A10\" or \"A1:A10\")."New value: +"A1 range, e.g. \"Sheet1!A1:A10\" or \"A1:A10\"."
    • changedInput schema / properties / show_dropdown / description
      Previous value: -"For ONE_OF_LIST, whether to show the dropdown UI."New value: +"For ONE_OF_LIST — True (default) renders the\ndropdown arrow; False hides it while still enforcing the\nrule."
    • changedInput schema / properties / spreadsheet_id / description
      Previous value: -"ID of the spreadsheet."New value: +"Target spreadsheet ID."
    • changedInput schema / properties / strict / description
      Previous value: -"If True, rejects invalid input. If False, shows a warning."New value: +"True rejects invalid input outright. False shows a\nwarning but accepts the entry."
    • addedInput schema / properties / user_google_email / description
      Added value: +"The user's Google email address (authenticated\naccount)."
    • changedInput schema / properties / validation_type / description
      Previous value: -"One of ONE_OF_LIST, NUMBER_BETWEEN, NUMBER_GREATER,\nNUMBER_LESS, NUMBER_EQ, TEXT_CONTAINS, TEXT_EQ, DATE_AFTER, DATE_BEFORE,\nDATE_ON_OR_AFTER, DATE_ON_OR_BEFORE, CUSTOM_FORMULA, BOOLEAN."New value: +"ONE_OF_LIST, NUMBER_BETWEEN, NUMBER_GREATER,\nNUMBER_LESS, NUMBER_EQ, TEXT_CONTAINS, TEXT_EQ, DATE_AFTER,\nDATE_BEFORE, DATE_ON_OR_AFTER, DATE_ON_OR_BEFORE,\nCUSTOM_FORMULA, or BOOLEAN."
    • changedInput schema / properties / values / description
      Previous value: -"List of allowed values (for ONE_OF_LIST) or bounds (for NUMBER_BETWEEN\npass [min, max]). For single-value conditions, pass [value]."New value: +"For ONE_OF_LIST: allowed dropdown options. For\nNUMBER_BETWEEN: [min, max]. For single-value conditions:\n[value]. Ignored for BOOLEAN and CUSTOM_FORMULA."
  2. First observedv1.19.0

TDQS

A4.4/5.0
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