Skip to main content
Glama

files_set_formula

Destructive

Sets a spreadsheet FORMULA at the given cell and returns once it is computed (formulas evaluate synchronously — unlike files_run code, no waiting). This is the preferred way to compute values — use a formula whenever it can do the task; fall back to files_run code only when the functionality is not available in formulas. Use A1-style formulas like 'SUM(A1:A10)', 'B2*1.2', 'VLOOKUP(...)'; a leading '=' is optional. Excel's English notation (',' between arguments, '.' as the decimal point) is converted to the Russian notation the file stores and files_read_code returns (';' between arguments, ',' as the decimal point); formulas already in Russian notation are kept as is. For a tiny in-cell chart use SPARKLINE, e.g. 'SPARKLINE(B2:M2, {"charttype", "column"})'. Requires edit permission; applied through the collaboration server. To read the computed value, files_read the cell. Signature: files_set_formula(file_uuid, cell, formula, sheet?).

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>",
      "cell": "<cell>",
      "formula": "<formula>"
    },
    "name": "files_set_formula"
  }
}

Input Schema

NameRequiredDescriptionDefault
cellYesAnchor cell in A1 notation, e.g. 'C2'.
sheetNoSheet name (defaults to the first sheet).
formulaYesFormula expression, e.g. 'SUM(A1:A10)' or '=A1*2'.
file_uuidYes

Output Schema

NameRequiredDescriptionDefault
cellYes
noteNo
file_uuidYes
sequence_numberYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already flag destructiveHint and non-idempotent, but the description adds substantial context: synchronous evaluation (no polling needed), permission requirement, application through the collaboration server, and full notation-conversion behavior. It stops short of saying the cell's existing content is overwritten, which would have closed the destructive-behavior loop.

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 verb and the key contrast against files_run, and every sentence carries information (preference, syntax, locale conversion, SPARKLINE, permissions). The notation-conversion passage is somewhat dense but earns its place for an agent authoring formulas.

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?

Output schema exists, so no return-value explanation is needed; the description still adds that evaluation is synchronous and the value is read via files_read. The one gap is overwrite semantics for the target cell, minor given destructiveHint is already declared.

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?

With 75% schema coverage the baseline is 3, and the description earns above that: it specifies A1-style formula syntax, that a leading '=' is optional, the argument-separator/decimal-point conversion rules, and a SPARKLINE example. Only file_uuid goes undiscussed, and that is self-explanatory.

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 ('Sets a spreadsheet FORMULA at the given cell') and immediately contrasts it with the sibling files_run for code execution. An agent can identify the tool and its scope without opening the schema.

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?

Gives an explicit preference policy: formulas are 'the preferred way to compute values', fall back to files_run only when the functionality is unavailable. It also names files_read for retrieving the result, so the surrounding workflow is fully routed.

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