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

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

Official

Define variable

define_variable
DestructiveIdempotent

Create or repoint a readable Excel name for a cell so input and output tools can use a key like Revenue instead of a cell reference.

Instructions

Create a defined name for a cell, or repoint an existing one, so set_inputs and get_outputs can use a readable key ("Revenue") instead of a cell ref. A name that already exists in the same scope is overwritten with the new target; no cell's value or formula changes. Names follow Excel's rules (start with a letter, _ or , no spaces, not a cell ref) and invalid ones fail the call. Returns {name, refers_to, defined_names}, the last being every name after the change. To remove a name use delete_variable; to see the existing names first, use inspect_model.

Input Schema

NameRequiredDescriptionDefault
nameYesName to create or repoint, following Excel's name rules (e.g. "Revenue", "Exit_Cap")
refers_toYesCell reference the name points to (e.g. "Sheet1!$A$1")
session_idYesSession ID returned by create_session (list_sessions shows the open ones)
scope_sheetNo0-based sheet index for a sheet-scoped name; omit for workbook scope

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv0.3.2
    • changedInput schema / properties / name / description
      Previous value: -"Variable name (e.g. \"Revenue\")"New value: +"Name to create or repoint, following Excel's name rules (e.g. \"Revenue\", \"Exit_Cap\")"
    • changedInput schema / properties / refers_to / description
      Previous value: -"Cell reference (e.g. \"Sheet1!$A$1\")"New value: +"Cell reference the name points to (e.g. \"Sheet1!$A$1\")"
    • changedInput schema / properties / scope_sheet / description
      Previous value: -"Sheet index for sheet-scoped name"New value: +"0-based sheet index for a sheet-scoped name; omit for workbook scope"
    • changedInput schema / properties / session_id / description
      Previous value: -"Session ID"New value: +"Session ID returned by create_session (list_sessions shows the open ones)"
  2. First observedv0.3.1

TDQS

A4.5/5.0
Behavior4/5

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

Beyond the annotations it discloses what actually gets destroyed (an existing name in the same scope is overwritten with the new target), that no cell value or formula is affected, and that invalid identifiers cause the call to fail. The overwrite semantics reconcile well with destructiveHint=true and idempotentHint=true. It doesn't mention session lifecycle or whether the change must be committed, which is the only notable gap.

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

Conciseness5/5

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

Purpose is front-loaded in the first clause, followed by overwrite behavior, naming constraints, return shape, and alternatives in that order. Four sentences and none of them is filler.

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 compensates by naming the returned fields ({name, refers_to, defined_names}) and explaining what the last one contains. Validation behavior, overwrite semantics, and sibling routing are all present for a 4-parameter mutation tool.

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 coverage is 100%, so the schema already documents name, refers_to, session_id and scope_sheet. The description adds only the notion of scoping ('a name that already exists in the same scope'), without clarifying workbook vs sheet scope interaction. Baseline 3 is appropriate given the schema does the heavy lifting.

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 a specific verb and resource ('Create a defined name for a cell, or repoint an existing one') and immediately gives the reason it exists (so set_inputs/get_outputs can use a readable key). That framing distinguishes it cleanly from delete_variable and inspect_model without needing the schemas.

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?

It states the downstream tools that consume the name, names delete_variable as the removal path, and points to inspect_model for listing existing names before calling. The overwrite-in-place case is also spelled out, so both the 'use this' and 'use something else' conditions are covered.

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