Skip to main content
Glama

files_set_custom_validation

Adds a custom formula validation to a range — Excel's "Custom" data-validation type: the value is accepted when the formula evaluates to TRUE. Write the formula for the top-left cell of the range; relative references shift for every other cell, as in Excel. The formula sees the value being entered, so "=A1>0" on A1:A10 rejects a negative number as it is typed. strict (default true): reject invalid entries; false warns. Pass 'id' (from files_validations) to replace. Requires edit permission. Signature: files_set_custom_validation(file_uuid, range, formula, sheet?, id?, strict?, ignore_blank?).

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_uuid": "<file_uuid>",
      "range": "<range>",
      "formula": "<formula>"
    },
    "name": "files_set_custom_validation"
  }
}

Input Schema

NameRequiredDescriptionDefault
idNoExisting validation id to replace; omit to create a new one.
rangeYesA1 range the rule applies to, e.g. 'B2:B100'.
sheetNoSheet name (defaults to the first sheet).
strictNotrue (default) rejects invalid entries; false only warns.
formulaYesFormula that must be TRUE for the value to pass, e.g. '=AND(A1>0,A1<100)'. Written for the top-left cell of the range; English and Russian notation are both accepted, as in files_set_formula.
file_uuidYes
ignore_blankNotrue (default) lets empty cells pass.

Output Schema

NameRequiredDescriptionDefault
rangeYes
file_uuidYes
sequence_numberYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Goes well beyond the annotations: discloses the edit-permission requirement, the replacement-vs-create semantics of 'id', the strict/warn distinction, and the relative-reference shifting behavior across the range. This is exactly the mutation context the annotations alone (destructiveHint=false, idempotentHint=false) would not convey.

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?

Front-loaded with the core purpose and formula model, then defaults and prerequisites. The trailing signature line largely restates the schema parameters, which is mild redundancy, but the body is dense and earns its space.

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?

A 7-parameter mutation tool with an output schema is fully covered: permission requirements, creation vs replacement, default behaviors, and the formula authoring model are all present. Nothing an agent needs to invoke it correctly is missing.

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

Parameters4/5

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

Schema coverage is already 86%, and the description still adds real value: it explains that the formula is written for the top-left cell and shifts relatively, that English and Russian notation are accepted, and that strict defaults to true. Coverage is high and the added semantics are nontrivial, so it clears the baseline 3 comfortably.

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 and resource ('Adds a custom formula validation to a range') and immediately pins down the exact Excel feature it maps to ('Custom' data-validation type). This clearly separates it from sibling validation setters like files_set_dropdown, files_set_number_validation, and files_set_text_validation.

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?

Explains the acceptance condition (formula must evaluate TRUE), how to replace an existing rule via 'id' from files_validations, and the strict vs warn tradeoff. It doesn't explicitly say when to pick this over the other validation-type siblings, but the semantic model makes the choice fairly obvious.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources