Skip to main content
Glama

add_data_validation

Restrict cell input in Excel by adding data validation rules such as dropdown lists, number ranges, date limits, or custom formulas with error messages and input prompts.

Instructions

Add a data-validation input rule to a range.

validation_type:

  • 'list': in-cell dropdown; pass options=["Yes","No"] (literal values) or formula='=$F$1:$F$5' to source the choices from cells.

  • 'whole', 'decimal', 'date', 'text_length': pass operator (between, notBetween, equal, notEqual, greaterThan, greaterThanOrEqual, lessThan, lessThanOrEqual) and values (two for between/notBetween, otherwise one). Dates are ISO strings like '2026-01-31'.

  • 'custom': pass formula, e.g. '=ISNUMBER(A2)'.

error_message customizes the rejection dialog; prompt shows a tooltip when the cell is selected. Rules take effect when the file is used in Excel.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
rangeYes
promptNo
valuesNo
formulaNo
optionsNo
operatorNo
session_idYes
allow_blankNo
error_messageNo
validation_typeYes
Behavior4/5

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

No annotations are provided, so the description bears full responsibility for behavioral disclosure. It explains that rules take effect in Excel, that error_message customizes the rejection dialog, and that prompt shows a tooltip. It also details parameter behavior per validation type. However, it does not clarify whether the tool replaces or merges with existing validation rules.

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 well-structured and efficient. It starts with a clear purpose sentence, then uses a logical bullet-like format (via line breaks) to explain each validation type. Every sentence serves a purpose, and the total length is appropriate given the complexity of the tool. No redundant information.

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?

Given the tool's complexity (10 parameters, conditional usage) and the absence of an output schema, the description covers the key use cases and parameter combinations. However, it omits edge cases such as handling of existing validation rules, range validity, and unspecified default behaviors for certain parameters.

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?

The input schema has 0% description coverage (titles only), so the description must compensate. It does so thoroughly by explaining each validation_type's required parameters (e.g., for 'list': options or formula; for 'whole': operator and values). It also clarifies the format for dates (ISO strings) and the purpose of error_message and prompt. This adds essential meaning beyond the 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 clearly states the tool's purpose: 'Add a data-validation input rule to a range.' It is specific about the resource (range) and action (add validation). Among many sibling tools focused on different sheet operations (e.g., add_chart, add_comment), this one is uniquely about data validation, making it easily distinguishable.

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 provides explicit guidance on which validation_type to use and what parameters are required for each type (e.g., 'list' requires options or formula, 'whole' requires operator and values). It does not explicitly mention when not to use this tool, but since no sibling tool performs data validation, the context is clear enough.

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/ShubhamDbug/Excel-MCP'

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