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 sheet

delete_sheet
Destructive

Deletes a sheet from a session workbook by 0-based index and recalculates affected formulas, turning references to the removed sheet into #REF!.

Instructions

Delete a sheet from a session's workbook, found by its 0-based index (see the sheets list from create_session or inspect_model), the way Excel does: formulas on other sheets that referenced it now read #REF! (Gone!A1 becomes #REF!A1) and evaluate to #REF!, a 3D range ending on it (Jan:Mar!B2) shrinks to the neighbouring sheet, names scoped to it are removed and names that pointed into it refer to #REF!. Sheets after it move down one index, so re-read indexes from the result before the next call. Works on imported and blank workbooks, and recalculates. It can't be undone: restore_session brings back other cells but not the sheet, so export_workbook or save_to_library first if you may need it. Returns {deleted: {sheet_index, sheet_name}, sheets: [{index, name}], active_sheet, formulas_broken (up to 200 cell refs), formulas_broken_count, names_removed, names_broken}. The last sheet, the last visible sheet or an index past the last sheet fails with bad_request and changes nothing. To retitle a sheet use rename_sheet; to empty one without breaking references, overwrite its cells with set_inputs.

Input Schema

NameRequiredDescriptionDefault
session_idYesSession ID returned by create_session (list_sessions shows the open ones)
sheet_indexYes0-based index of the sheet to delete

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.3.2

TDQS

A4.6/5.0
Behavior4/5

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

Goes well beyond the destructiveHint annotation: it discloses reference breakage semantics (#REF! propagation, 3D range shrink, scoped-name removal), index shifting after deletion, that it works on imported and blank workbooks, that it recalculates, and the exact irreversibility boundary (restore_session brings back cells but not the sheet). Only the return value enumeration is arguably redundant detail rather than behavior.

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 action and an immediate Excel analogy, and nearly every clause earns its place. It is a single dense paragraph with heavy parentheticals, though, and the inline enumeration of the return object could be trimmed or split for scannability.

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 two-parameter mutation with no output schema, the description supplies the return shape, error behavior, side effects on other sheets, and recovery options. Nothing an agent needs to call it safely and interpret the result 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 baseline is 3, but the description adds real meaning: it confirms the index is 0-based, tells the agent where to obtain valid indexes (create_session or inspect_model), and warns that indexes shift after a delete so they must be re-read from the result.

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 sheet from a session's workbook) plus the exact addressing scheme (0-based index, sourced from create_session or inspect_model). It is unmistakable against siblings like rename_sheet, add_sheet, and set_inputs, which are named as alternatives.

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 both when-to-use routes (rename_sheet to retitle, set_inputs to empty without breaking references) and explicit preconditions (export_workbook or save_to_library first because it cannot be undone). Also states the failure cases that change nothing: last sheet, last visible sheet, out-of-range index.

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