Skip to main content
Glama
xlsx-mcp-server
by knorq-ai

add_data_validation

Apply data validation rules to Excel ranges to restrict or guide cell input using lists, number, date, text length, or custom criteria.

Instructions

Add a data validation rule to a range (list, whole number, decimal, date, text length, custom).

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "file_path": "<file_path>",
      "sheet": "<sheet>",
      "range": "<range>",
      "type": "<type>",
      "formulae": "<formulae>"
    },
    "name": "add_data_validation"
  }
}

Input Schema

NameRequiredDescriptionDefault
typeYesValidation type
errorNoError popup message
rangeYesRange to apply validation (e.g. 'A1:A100')
sheetYesSheet name or 1-based index
promptNoInput hint message
formulaeYesValidation formulae (e.g. ['"Yes,No"'] for list, ['1','100'] for range)
operatorNoComparison operator
file_pathYesAbsolute path to the .xlsx file
allow_blankNoAllow blank cells
error_titleNoError popup title
prompt_titleNoInput hint title
show_error_messageNoShow error popup
show_input_messageNoShow input hint

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.0.0

TDQS

C2.9/5.0
Behavior2/5

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

With no annotations supplied, the description carries the full behavioral burden, yet it says nothing about mutation semantics: whether an existing validation on the range is replaced, whether the file is written to disk, whether a specific permission or file lock is needed, or how failures surface. The only disclosure is the list of supported rule types, which is already present in the schema enum.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single front-loaded sentence with no filler or redundancy. It is efficient, though its brevity borders on under-specification rather than tight economy.

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

Completeness2/5

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

For a mutation tool with 13 parameters, 5 required, no annotations, and no output schema, the description is far too thin. It never explains that formulae contents depend on the chosen type or that operator only applies to numeric/date types — details an agent cannot reliably derive from the flat schema alone.

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 every one of the 13 parameters is already documented, which sets the baseline at 3. The description's parenthetical type list slightly aids mapping human terms ("whole number", "text length") to the enum values ("whole", "textLength"), but it adds nothing about the critical formulae-vs-type coupling or operator applicability.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb and resource ("Add a data validation rule to a range") and enumerates the six rule kinds, so the agent knows exactly what the tool creates. It does not, however, name or contrast itself with siblings such as list_data_validations or remove_data_validation, leaving that routing to inference.

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?

There is no when-to-use guidance, no statement of when not to use it, and no mention of the alternative tools that inspect or remove validations. Nothing is said about prerequisites (existing .xlsx file, existing sheet), so the agent must guess the operational context.

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