Skip to main content
Glama
basis1: Excel engine for AI agents (formulas, recalculation, audit)

basis1: Excel engine for AI agents (formulas, recalculation, audit)

Official

Evaluate formula

evaluate_formula
Read-only

Test an Excel formula against sample cell values and return the computed result, type, and stats to verify logic before adding it to a workbook.

Instructions

Evaluate an Excel formula and return the computed result: a quick way to check what a formula returns on a few sample values before you put it in a workbook. Pass data as a map of cell references to values (e.g. {"A1": 100, "A2": true, "A3": "#N/A", "B1": "hello"}) and a formula string (e.g. "SUM(A1:A2)"). Values keep their Excel types, as in a workbook: true/false are logical cells (so SUM, AVERAGE and COUNT skip them in a range), a string that is exactly an error code (#N/A, #DIV/0!, #VALUE!, #REF!, #NAME?, #NUM!, #NULL!) is that error, and other strings are text. The formula is placed in row 1 of the first column right of your data, so don't reference that cell. Returns {formula, result, type, stats}, type being "number", "string", "boolean" or "error". A formula that evaluates to an Excel error returns type "error" with the code (#VALUE!, #N/A…) as a normal result; a formula that can't be parsed or uses an unsupported function is a tool error. Supports 278 Excel functions: math, financial (NPV, IRR, XIRR, PMT, PRICE, YIELD…), statistical distributions, regression, lookup, date/time, text, logical, and dynamic arrays (FILTER, SORT, UNIQUE, SEQUENCE, CHOOSECOLS, TAKE, DROP). Array expressions evaluate element by element inside SUMPRODUCT, LOOKUP, AGGREGATE, SMALL/LARGE, MATCH and INDEX. To check formulas that already live in a workbook, use create_session instead. Runs on the Basis API (needs an API key).

Input Schema

NameRequiredDescriptionDefault
dataNoCell data to populate before evaluating. Keys are cell references like "A1", "B2". Values are numbers, booleans (logical TRUE/FALSE), error codes such as "#N/A", or text.
formulaYesExcel formula to evaluate (without the leading '='), e.g. "SUM(A1:A2)" or "NPV(0.08,B1:B5)"

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.3.2
    • changedInput schema / properties / data / description
      Previous value: -"Cell data to populate before evaluating. Keys are cell references like \"A1\", \"B2\". Values can be numbers, strings, or booleans."New value: +"Cell data to populate before evaluating. Keys are cell references like \"A1\", \"B2\". Values are numbers, booleans (logical TRUE/FALSE), error codes such as \"#N/A\", or text."
  2. First observedv0.3.1

TDQS

A4.8/5.0
Behavior5/5

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

Annotations only declare readOnlyHint and openWorldHint; the description goes well beyond them. It discloses the return shape and the four possible `type` values, the critical distinction that Excel errors come back as a normal result while parse/unsupported-function failures are tool errors, the supported-function surface (278 functions, enumerated by category), and the odd placement rule that the formula lands in row 1 one column right of the data.

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 action and an example call, then progressively discloses type rules, return shape, and error semantics. It is dense but nearly every sentence carries real information; the long function-category list is the one portion that could be trimmed without much loss.

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?

There is no output schema, and the description fully compensates by specifying the {formula, result, type, stats} response and the meaning of each type value. For a tool with two well-defined params and a nontrivial evaluation model, it covers the prerequisite (API key), the edge cases (errors vs. tool errors, array expressions), and the scope boundary against siblings.

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 100%, so the baseline is 3, but the description earns more by explaining how values are interpreted: true/false are logical cells that SUM/AVERAGE/COUNT skip, an exact error code string becomes that error, and everything else is text. It also adds the non-obvious constraint that the formula is placed one column right of the data, so that cell must not be referenced — a rule absent from the schema.

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 ("Evaluate an Excel formula and return the computed result") and immediately bounds its scope as a quick pre-flight check rather than workbook-wide evaluation. It explicitly names the sibling that handles the other case ("To check formulas that already live in a workbook, use create_session instead"), so an agent can route without opening either 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 actionable when-to-use ("check what a formula returns on a few sample values before you put it in a workbook") and an explicit when-not-to-use with the alternative named (create_session for formulas already in a workbook). It also calls out the prerequisite that the tool runs on the Basis API and needs an API key.

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