Skip to main content
Glama
WilliamSmithEdward

xlide-excel-word-powerpoint-access-office-vba-mcp

Write module

xlide_write_module
DestructiveIdempotent

Write or replace a VBA module in Excel, Word, PowerPoint, or Access files. Uses a content token to prevent overwriting changed code, then returns a diff of the saved result.

Instructions

The canonical way to change VBA. Writes a module's source into the Office file and saves it. It replaces the module's whole source, so send all of it; send the body only, because the attribute header is managed for you. A module that does not exist is created: standard by default, or a class with kind='class'. Pass expected_content_token from your read and the write is refused if the module changed since. The result carries a diff of what the file now holds, read back after saving, which is what to show the user when they ask what changed. After writing, call xlide_analyze and treat any error as a build failure. Ask the user first when the project is protected or signed.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
kindNoKind for a module being created: 'standard' or 'class'.standard
sourceYesThe module's complete VBA source.
file_pathYesAbsolute path to the Office file.
module_nameYesModule to write, or to create.
include_diffNoInclude a unified diff of what changed. Off in a loop that writes many modules and reads none of them back.
allow_protectedNoWrite to a password-protected project. Ask the user first.
expected_content_tokenNoThe content_token from your read. Leave empty only when creating a module.
allow_invalidate_signatureNoWrite to a digitally signed project, dropping the signature. Ask the user first.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.4/5.0
Behavior5/5

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

Annotations already flag destructive and non-read-only behavior, so the description doesn't need to restate those. It adds meaningful specifics: full-source replacement, attribute-header management, conditional refusal via expected_content_token, diff read back after saving, and explicit user-consent requirements for protected/signed projects.

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 a dense but well-organized paragraph: core action first, then destructive semantics, creation behavior, concurrency token, return diff, follow-up analyze, and authorization caveats. No sentence is filler; the layout tracks the order an agent needs to reason through a write.

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 mutating tool with 8 parameters and an output schema, the description covers the behavioral corner cases: replacement semantics, class creation, stale-write refusal, diff display, post-write analysis, and protected/signed consent. It also explicitly delegates follow-up validation to xlide_analyze, leaving no obvious gap for correct invocation.

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?

With 100% schema coverage the baseline is 3, but the description goes well beyond it: it clarifies that source must be the module body only, that kind='class' creates a class module, that expected_content_token enforces optimistic concurrency, and that include_diff can be disabled in loops. This maps precisely to the optional parameters and makes their usage concrete.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with 'The canonical way to change VBA' and then specifies exactly what the tool does: writes a module's source into the Office file, saves it, replaces the whole source, and creates modules if missing. It clearly distinguishes the operation from read/delete/rename siblings in spirit, though it never names an alternative tool explicitly.

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?

It tells the agent to pass expected_content_token from a prior read, to call xlide_analyze after the write, and to ask the user first for protected or signed projects. However, it never contrasts itself with alternatives like xlide_import_modules or xlide_write_query, so the 'when not to use' guidance is only implied by the word 'canonical'.

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