Skip to main content
Glama

add_computed_column

Add calculated columns to Excel worksheets using pandas formulas, cumulative sums, or rolling aggregations.

Instructions

Add a computed column either via pandas-eval formula or as a cumsum/rolling operation.

Args: file_path: Workbook path. sheet_name: Worksheet name. new_column_name: Column name to add. expression: Expression string for pandas.eval when column_type=='formula'. has_header: Whether the sheet has a header row. column_type: One of 'formula', 'cumsum', 'rolling'. source_col: Required for 'cumsum' and 'rolling'. window: Integer window for rolling operations. rolling_func: Aggregation for rolling (default 'mean').

Returns: str: Message indicating success and destination column.

Notes: - Accepts user-provided expressions — underlying code performs AST checks; docstring should link to safety doc.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
windowNo
file_pathYes
expressionYes
has_headerNo
sheet_nameYes
source_colNo
column_typeNoformula
rolling_funcNomean
new_column_nameYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior3/5

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

With no annotations provided, the description carries the full burden. It DOES disclose that user-provided expressions are accepted and that AST checks are performed, which is valuable safety context. However, it does not state whether the operation modifies the file in place, whether it can overwrite existing columns, or what happens on invalid expressions. The final note 'docstring should link to safety doc' is a meta instruction rather than user-facing behavior, adding confusion without improving transparency.

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?

The description is structured clearly with a one-sentence summary, Args list, Returns, and Notes. It is appropriately sized for 9 parameters. However, the last note 'docstring should link to safety doc' is an internal development instruction that does not belong in a user-facing tool description, adding unnecessary noise. Otherwise, every sentence earns its place.

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?

For a tool with 9 parameters and two distinct operation modes, the description is quite thorough: it covers all parameters, the return type, and a safety check. It lacks explicit when-to-use guidance relative to siblings and does not mention side effects like file persistence, but given the complexity and the existence of an output schema describing a string message, the description is largely complete. The confusing meta note slightly detracts from completeness.

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?

The Args list describes all 9 parameters, adding meaning well beyond the schema (which has 0% description coverage). It explains each parameter's role, gives conditional requirements (e.g., 'source_col: Required for cumsum and rolling'), notes defaults (rolling_func) and type-specific usage (expression for pandas.eval). This fully compensates for the schema's lack of descriptions.

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: 'Add a computed column either via pandas-eval formula or as a cumsum/rolling operation.' It clearly distinguishes from sibling tools like formula_write by focusing on adding a new column rather than writing formulas to existing cells. The two operation modes provide additional precision.

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 explains the two operation modes (formula, cumsum, rolling) and identifies which parameters are required for each, giving implicit context for when to use certain arguments. However, it does not explicitly state when to prefer this tool over siblings such as formula_write or aggregate_data, nor does it mention exclusions or prerequisites like file locks or existing column constraints.

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