Skip to main content
Glama

formula_write

Write Excel formulas by setting, batch-setting, filling, or auto-summing cells. Handles single formulas, multiple formulas at once, filling a range, or summing a source range.

Instructions

Set, batch-set, fill or auto-sum formulas in cells.

Args: action: "set", "batch", "fill", or "auto_sum". - "set": requires cell_ref and formula (is_array optional, target_range optional). - "batch": requires formulas dict mapping cell_ref to formula string, e.g. {"A1": "=SUM(B1:B10)", "A2": "=AVERAGE(C1:C10)"}. - "fill": requires cell_ref (source) and target_range. - "auto_sum": requires cell_ref (destination) and optional source_range. file_path, sheet_name: Workbook and sheet to modify. is_array: Whether the formula is an array formula. target_range, formulas, source_range: Operation-specific params.

Returns: str | dict: Success message or batch result.

Notes: - Writing formulas mutates the workbook. fill uses formula translation utilities; verify absolute/relative reference behaviour.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
actionYes
formulaNo
cell_refNo
formulasNo
is_arrayNo
file_pathYes
sheet_nameYes
source_rangeNo
target_rangeNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

With no annotations provided, the description carries the full burden. It explicitly warns 'Writing formulas mutates the workbook' and notes that 'fill' uses formula translation utilities, advising verification of absolute/relative reference behavior. This provides meaningful behavioral context beyond the schema, though it omits details like error conditions or permissions.

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?

The description is well-structured with clear sections (Args, Returns, Notes) and a concise bulleted action list. The only minor redundancy is the final line listing operation-specific params, which repeats earlier details, but overall the text is efficient and front-loaded with the purpose.

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 (9 params, 4 operation modes, output schema), the description covers operation semantics, return types, the mutation side effect, and a caveat about fill behavior. It does not address error handling or permission requirements, but the presence of an output schema lessens the need to explain return values, making it reasonably complete.

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?

Despite 0% schema description coverage, the description explains every parameter's role, includes a concrete example for the 'formulas' dict, and specifies operation-specific parameter requirements. This fully compensates for the schema's lack of descriptions, adding meaning beyond the parameter names.

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 opens with 'Set, batch-set, fill or auto-sum formulas in cells', clearly stating the verb and resource with specific operations. This distinguishes it from sibling tools like formula_audit and write_cells, which serve different purposes.

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 Args section provides detailed per-action requirements (e.g., 'set' requires cell_ref and formula), offering clear context on when to use each operation. However, it does not explicitly mention alternative sibling tools or exclusions, so the guidance stops short of full when-to-use versus alternatives.

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/mbeps/excel-mcp'

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