Skip to main content
Glama

Add data validation

add_data_validation

Restrict cell entries in an Excel range using dropdown lists, number, date, time, text length, or custom formula rules, with optional prompts and error alerts.

Instructions

Restrict what can be entered in a range (list dropdown, numbers, dates, times, text length or custom formula), with optional input message and error alert.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes
ruleYes
rangeYes
sheetYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed58 schema fields changedv2.0.0
    • removedInput schema / $defs / DataValidationRule / description
      Removed value: -"A data validation rule. Which fields are used depends on ``type``."
    • removedInput schema / $defs / DataValidationRule / properties / allow_blank / description
      Removed value: -"Allow empty cells."
    • removedInput schema / $defs / DataValidationRule / properties / allow_blank / title
      Removed value: -"Allow Blank"
    • removedInput schema / $defs / DataValidationRule / properties / error_message / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • removedInput schema / $defs / DataValidationRule / properties / error_message / default
      Removed value: -null
    • removedInput schema / $defs / DataValidationRule / properties / error_message / description
      Removed value: -"Shown when input is rejected."
    • addedInput schema / $defs / DataValidationRule / properties / error_message / maxLength
      Added value: +255
    • removedInput schema / $defs / DataValidationRule / properties / error_message / title
      Removed value: -"Error Message"
    • addedInput schema / $defs / DataValidationRule / properties / error_message / type
      Added value: +"string"
    • addedInput schema / $defs / DataValidationRule / properties / error_style
      Added value: +{
      +  "default": "stop",
      +  "description": "stop rejects bad input; others let it stay.",
      +  "enum": [
      +    "stop",
      +    "warning",
      +    "information"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / $defs / DataValidationRule / properties / error_title
      Added value: +{
      +  "maxLength": 32,
      +  "type": "string"
      +}
    • removedInput schema / $defs / DataValidationRule / properties / formula / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • removedInput schema / $defs / DataValidationRule / properties / formula / default
      Removed value: -null
    • changedInput schema / $defs / DataValidationRule / properties / formula / description
      Previous value: -"custom only, e.g. '=A2>B2'."New value: +"custom: for the top-left cell, e.g. '=A2>B2'."
    • removedInput schema / $defs / DataValidationRule / properties / formula / title
      Removed value: -"Formula"
    • addedInput schema / $defs / DataValidationRule / properties / formula / type
      Added value: +"string"
    • removedInput schema / $defs / DataValidationRule / properties / maximum / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • removedInput schema / $defs / DataValidationRule / properties / maximum / default
      Removed value: -null
    • changedInput schema / $defs / DataValidationRule / properties / maximum / description
      Previous value: -"Second bound for between/notBetween."New value: +"For between."
    • removedInput schema / $defs / DataValidationRule / properties / maximum / title
      Removed value: -"Maximum"
    • addedInput schema / $defs / DataValidationRule / properties / maximum / type
      Added value: +"string"
    • removedInput schema / $defs / DataValidationRule / properties / minimum / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • removedInput schema / $defs / DataValidationRule / properties / minimum / default
      Removed value: -null
    • changedInput schema / $defs / DataValidationRule / properties / minimum / description
      Previous value: -"First bound, number or formula."New value: +"Number or formula; dates '2026-01-31', times '09:30'."
    • removedInput schema / $defs / DataValidationRule / properties / minimum / title
      Removed value: -"Minimum"
    • addedInput schema / $defs / DataValidationRule / properties / minimum / type
      Added value: +"string"
    • removedInput schema / $defs / DataValidationRule / properties / operator / anyOf
      Removed value: -[
      -  {
      -    "enum": [
      -      "between",
      -      "notBetween",
      -      "equal",
      -      "notEqual",
      -      "greaterThan",
      -      "lessThan",
      -      "greaterThanOrEqual",
      -      "lessThanOrEqual"
      -    ],
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • removedInput schema / $defs / DataValidationRule / properties / operator / default
      Removed value: -null
    • changedInput schema / $defs / DataValidationRule / properties / operator / description
      Previous value: -"whole, decimal, date and text_length."New value: +"Not for list and custom."
    • addedInput schema / $defs / DataValidationRule / properties / operator / enum
      Added value: +[
      +  "between",
      +  "notBetween",
      +  "equal",
      +  "notEqual",
      +  "greaterThan",
      +  "lessThan",
      +  "greaterThanOrEqual",
      +  "lessThanOrEqual"
      +]
    • removedInput schema / $defs / DataValidationRule / properties / operator / title
      Removed value: -"Operator"
    • addedInput schema / $defs / DataValidationRule / properties / operator / type
      Added value: +"string"
    • removedInput schema / $defs / DataValidationRule / properties / options / anyOf
      Removed value: -[
      -  {
      -    "items": {
      -      "type": "string"
      -    },
      -    "type": "array"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • removedInput schema / $defs / DataValidationRule / properties / options / default
      Removed value: -null
    • changedInput schema / $defs / DataValidationRule / properties / options / description
      Previous value: -"list only: allowed values."New value: +"list: allowed values."
    • addedInput schema / $defs / DataValidationRule / properties / options / items
      Added value: +{
      +  "type": "string"
      +}
    • removedInput schema / $defs / DataValidationRule / properties / options / title
      Removed value: -"Options"
    • addedInput schema / $defs / DataValidationRule / properties / options / type
      Added value: +"array"
    • removedInput schema / $defs / DataValidationRule / properties / prompt / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • removedInput schema / $defs / DataValidationRule / properties / prompt / default
      Removed value: -null
    • changedInput schema / $defs / DataValidationRule / properties / prompt / description
      Previous value: -"Hint shown when a cell is selected."New value: +"Input message."
    • addedInput schema / $defs / DataValidationRule / properties / prompt / maxLength
      Added value: +255
    • removedInput schema / $defs / DataValidationRule / properties / prompt / title
      Removed value: -"Prompt"
    • addedInput schema / $defs / DataValidationRule / properties / prompt / type
      Added value: +"string"
    • addedInput schema / $defs / DataValidationRule / properties / prompt_title
      Added value: +{
      +  "description": "Input message title.",
      +  "maxLength": 32,
      +  "type": "string"
      +}
    • addedInput schema / $defs / DataValidationRule / properties / source
      Added value: +{
      +  "description": "list, instead of options: one row or column or a name, e.g. '=$A$2:$A$20' or '=Regions'.",
      +  "type": "string"
      +}
    • removedInput schema / $defs / DataValidationRule / properties / type / description
      Removed value: -"Kind of rule."
    • changedInput schema / $defs / DataValidationRule / properties / type / enum
      Previous value: -[
      -  "list",
      -  "whole",
      -  "decimal",
      -  "date",
      -  "text_length",
      -  "custom"
      -]New value: +[
      +  "list",
      +  "whole",
      +  "decimal",
      +  "date",
      +  "time",
      +  "text_length",
      +  "custom"
      +]
    • removedInput schema / $defs / DataValidationRule / properties / type / title
      Removed value: -"Type"
    • removedInput schema / $defs / DataValidationRule / title
      Removed value: -"DataValidationRule"
    • removedInput schema / properties / path / description
      Removed value: -"Path to an .xlsx, .xlsm, .xltx or .xltm file. Relative paths are resolved in the server's workbook directory when one is configured; otherwise use an absolute path."
    • removedInput schema / properties / path / title
      Removed value: -"Path"
    • removedInput schema / properties / range / description
      Removed value: -"A cell or rectangular range in A1 notation, e.g. 'A1:D20'."
    • removedInput schema / properties / range / title
      Removed value: -"Range"
    • removedInput schema / properties / sheet / description
      Removed value: -"Worksheet name, e.g. 'Sheet1'."
    • removedInput schema / properties / sheet / title
      Removed value: -"Sheet"
    • removedInput schema / title
      Removed value: -"add_data_validationArguments"
    • changedOutput schema / (root)
      Previous value: -{
      -  "properties": {
      -    "result": {
      -      "title": "Result",
      -      "type": "string"
      -    }
      -  },
      -  "required": [
      -    "result"
      -  ],
      -  "title": "add_data_validationOutput",
      -  "type": "object"
      -}New value: +null
  2. Addedv1.1.1

TDQS

A3.5/5.0
Behavior3/5

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

Annotations already declare the mutation profile (readOnlyHint=false, destructiveHint=false, idempotentHint=false), so safety is partly covered. The description adds that input messages and error alerts are optional, but it does not disclose whether existing validation is overwritten, how apply-to-range semantics work, or permission needs. Adds moderate value beyond annotations but leaves key behavioral questions open.

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?

A single front-loaded sentence with the core action first, then a parenthetical of supported modes. No wasted words and no redundancy.

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

Completeness3/5

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

For a mutating tool with only partial annotation coverage and no output schema, the description covers what it does but omits prerequisites, overwrite/repeat-application behavior, and the meaning of the required path/sheet/range parameters. Adequate minimum but with clear gaps.

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?

Top-level required params (path, sheet, range, rule) have no schema descriptions and are not explained in the prose, so the description leaves their meaning entirely to inference. It does enrich the nested rule concept by mapping the validation modes and the optional message/error fields, partially compensating for the low coverage.

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?

States a specific verb+resource ('Restrict what can be entered in a range') and enumerates the supported validation modes (list, numbers, dates, times, text length, custom formula). An agent can immediately tell this is data-validation authoring and not, say, formatting or conditional formatting, which distinguishes it from nearby siblings like format_range and add_conditional_format.

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

Usage Guidelines2/5

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

The description never says when to reach for this tool versus alternatives, nor does it warn about interaction with conditional formatting. There is no explicit when/when-not guidance and no prerequisites (e.g. that the range must exist, or what happens if validation already exists).

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