Skip to main content
Glama

execute_vba

Run VBA code in open Excel workbooks to automate tasks, process data, or customize functionality. Code executes within temporary modules that are automatically cleaned up.

Instructions

Execute VBA code in an open workbook (live Excel only, cannot use with closed files). Code is wrapped in a Sub automatically if needed. MsgBox calls are stripped. Temp modules are cleaned up after execution.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
workbookYesWorkbook name
codeYesVBA code to execute
sheetNoSheet to activate before execution
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 effectively describes key behaviors: code is automatically wrapped in a Sub if needed, MsgBox calls are stripped, and temp modules are cleaned up after execution. This adds valuable context beyond basic execution, though it could mention permissions or error handling.

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 appropriately sized and front-loaded, with three concise sentences that each add value: stating the core action, specifying constraints, and detailing behavioral traits. There is no wasted text, and it efficiently communicates essential information.

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?

Given the tool's complexity (executing code in Excel) and no annotations or output schema, the description is mostly complete. It covers purpose, constraints, and behavioral traits, but could improve by mentioning return values or error scenarios. It adequately supports agent usage without being exhaustive.

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 description coverage is 100%, so the schema already documents all three parameters (workbook, code, sheet). The description does not add meaning beyond the schema, such as examples or format details for parameters. Baseline 3 is appropriate as the schema handles parameter documentation adequately.

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 specific action ('Execute VBA code') and resource ('in an open workbook'), distinguishing it from sibling tools like format_cells or read_cells. It specifies the scope ('live Excel only, cannot use with closed files'), making the purpose unambiguous and distinct.

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

Usage Guidelines4/5

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

The description provides clear context on when to use this tool ('live Excel only, cannot use with closed files'), but does not explicitly mention when not to use it or name alternatives among sibling tools. It implies usage for executing VBA code in active workbooks, which is helpful but lacks explicit exclusions or comparisons.

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/kousunh/Excel-mcp-server'

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