Skip to main content
Glama

Numbers: set formula

numbers_set_formula
Destructive

Insert a formula into one cell of a Numbers file and return the computed result. Use dry_run to preview changes without modifying the file.

Instructions

Put a formula in one cell, e.g. ref "D10", formula "=SUM(D2:D9)"; Numbers computes it and the result is returned. Every other cell's input is verified unchanged. Needs macOS + Numbers, file closed. dry_run=true previews the change on a copy without touching the file. Use for a cell that calculates (=SUM…); Numbers computes the result. For a plain value use numbers_edit_cell. Needs the Numbers app.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
refYesOne cell in A1 notation, e.g. "B2".
pathYesPath to the .numbers file (absolute, or starting with ~).
sheetNoSheet name. Omit when the file has one sheet (iwork_read lists sheets and tables).
tableNoTable name on that sheet. Omit when the sheet has one table.
dry_runNotrue = make the change on a throwaway copy, run every check, and return what would change; the file itself is not touched. Use it before broad or risky edits and show the user.
formulaYesThe formula, starting with "=", e.g. "=SUM(B2:B9)".

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changedv2.4.1
    • addedInput schema / properties / dry_run / description
      Added value: +"true = make the change on a throwaway copy, run every check, and return what would change; the file itself is not touched. Use it before broad or risky edits and show the user."
    • addedInput schema / properties / formula / description
      Added value: +"The formula, starting with \"=\", e.g. \"=SUM(B2:B9)\"."
    • addedInput schema / properties / path / description
      Added value: +"Path to the .numbers file (absolute, or starting with ~)."
    • addedInput schema / properties / ref / description
      Added value: +"One cell in A1 notation, e.g. \"B2\"."
    • addedInput schema / properties / sheet / description
      Added value: +"Sheet name. Omit when the file has one sheet (iwork_read lists sheets and tables)."
    • addedInput schema / properties / table / description
      Added value: +"Table name on that sheet. Omit when the sheet has one table."
  2. First observedv2.4.0

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true and idempotent=false, so the mutation profile is known; the description adds real context beyond that — the result is returned, every other cell is verified unchanged, the file must be closed and macOS+Numbers present, and dry_run previews on a copy. It does not state reversibility (e.g. no undo/backup mention), which keeps it short of a 5.

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

Conciseness3/5

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

Content is front-loaded with the example, but it repeats itself: 'Numbers computes it and the result is returned' recurs as 'Numbers computes the result', and the Numbers-app requirement appears twice ('Needs macOS + Numbers' and 'Needs the Numbers app'). Two sentences could be cut without information loss.

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?

An output schema exists, so return-value explanation is unnecessary, and prerequisites (closed file, macOS+Numbers) plus dry_run semantics are covered. Minor gap: no note on what happens if the ref is invalid or already contains a value, but the essentials for correct invocation are present.

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 all six parameters are documented in the schema itself. The description revisits ref and formula with examples but adds no semantics the schema lacks (sheet/table omission rules, dry_run behavior are all in the schema). Baseline 3 applies.

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 ('Put a formula in one cell') with a concrete example, and explicitly contrasts itself with the sibling numbers_edit_cell for plain values. An agent can distinguish this from numbers_edit_cell and numbers_recalculate without opening a 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 the when ('a cell that calculates (=SUM…)'), the when-not ('For a plain value use numbers_edit_cell'), and a conditional path for dry_run previews before risky edits. The routing to the alternative is explicit rather than implied.

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