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

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

Official

Delete variable

delete_variable
DestructiveIdempotent

Remove a defined name from a session's workbook while preserving its cell data; if formulas still use the name, deletion fails and lists cells to update.

Instructions

Delete a defined name from a session's workbook, e.g. one you made with define_variable and no longer need. Only the name goes; the cell it pointed to keeps its value and formula. Match is by name, ignoring case, in workbook scope or, with scope_sheet, the name scoped to that sheet. A name still used by a formula is not deleted: the call fails with name_in_use and lists those cells, so rewrite them with set_inputs (or repoint the name with define_variable) first. A name that doesn't exist in that scope fails with not_found, and Excel's built-in names (print areas, filters) can't be deleted. restore_session doesn't bring a deleted name back; define_variable recreates it. Returns {deleted, scope_sheet, defined_names}, the last being every name left. To see the names first, use inspect_model.

Input Schema

NameRequiredDescriptionDefault
nameYesDefined name to delete, e.g. "Exit_Cap" (case doesn't matter)
session_idYesSession ID returned by create_session (list_sessions shows the open ones)
scope_sheetNo0-based sheet index of a sheet-scoped name; omit for a workbook-scoped name

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.3.2

TDQS

A4.8/5.0
Behavior5/5

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

Annotations declare destructive=true and idempotent=true, but the description adds substantial context beyond them: only the name is removed while the target cell keeps its value and formula, in-use names fail with name_in_use plus the offending cells, missing names fail with not_found, built-in Excel names are undeletable, and restore_session will not resurrect the name. That is exactly the blast-radius and reversibility information an agent needs before a delete call.

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 purpose, then failure modes, side effects, and return shape in a logical progression with no filler sentences. It is dense rather than bloated, though the failure-mode sentence is long enough that it could be split for faster scanning.

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?

For a destructive mutation with no output schema, the description covers the deletion scope, side effects on the referenced cell, both error modes with their causes, irreversibility relative to restore_session, and even the return payload fields. Nothing an agent needs before invoking it is missing.

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; the description still adds matching semantics by explaining that lookup is case-insensitive, that omitting scope_sheet means workbook scope, and that supplying it targets the sheet-scoped name — plus that a name absent from that particular scope returns not_found. This clarifies the scope_sheet choice beyond the schema's bare field description.

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 ("Delete a defined name from a session's workbook") and immediately distinguishes it from sibling define_variable by naming the origin case. An agent can tell this apart from define_variable, inspect_model, and restore_session without opening any 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?

Explicit when-to-use ("one you made with define_variable and no longer need"), explicit precondition handling (rewrite with set_inputs or repoint with define_variable before deleting an in-use name), and explicit routing to inspect_model to see names first. Alternatives and their selection conditions are all named.

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