Skip to main content
Glama

insert_subtotals

Insert SUBTOTAL formula rows after each group in an Excel sheet, using specified group and value columns, with optional grand total.

Instructions

Insert SUBTOTAL formula rows after each group in a sorted sheet.

Args: file_path: Workbook path. sheet_name: Worksheet name. group_col: Column used to group rows. value_col: Column to subtotal. subtotal_func: Excel subtotal function code (9=SUM by default). include_grand_total: Whether to append a grand total row.

Returns: dict: Summary including ranges where subtotals were inserted.

Notes: - Destructive: modifies the sheet structure and inserts new rows.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_pathYes
group_colYes
value_colYes
sheet_nameYes
subtotal_funcNo
include_grand_totalNo
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It explicitly notes that the tool is destructive, modifies the sheet structure, and inserts new rows, and it describes the return format. This covers key concerns, though it does not mention error handling or side effects beyond structural changes.

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?

The description is well-structured with a one-sentence purpose followed by clear Args, Returns, and Notes sections. It is concise, avoids redundancy, and every line of the description adds value.

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?

The description covers all parameters, notes destructiveness, and describes the return value, providing a solid basis for invocation. However, some details remain unspecified, such as the exact format for group_col/value_col and the full list of subtotal_func codes, leaving minor gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, making the description's parameter explanations essential. It provides concise but meaningful definitions for all six parameters, including the default for subtotal_func and the purpose of include_grand_total, adding significant value beyond 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?

The description clearly states the tool inserts SUBTOTAL formula rows after each group in a sorted sheet, providing a specific verb, resource, and scope. This distinguishes it from sibling aggregation tools that may not modify the sheet structure.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description indicates the need for a sorted sheet as a precondition, but does not provide explicit guidance on when to use this tool versus alternatives like aggregate_data or column_statistics. No exclusions or alternative recommendations are given, leaving usage to inference.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/mbeps/excel-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server