Skip to main content
Glama
WilliamSmithEdward

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

Edit module lines

xlide_edit_module
DestructiveIdempotent

Replaces, inserts, or deletes line ranges in an existing VBA module and saves once. Requires a content token to prevent stale edits; preview only validates without saving.

Instructions

Replaces, inserts or deletes several line ranges in one existing VBA module and saves once. Lines are 1-based against the original source returned by xlide_read_module, without the attribute header. Each edit has start_line, end_line inclusive, and replacement text. For insertion, set end_line to start_line - 1; an empty replacement deletes the named lines. Ranges must not overlap. expected_content_token is required and refuses a stale edit. Set preview_only to validate the edits and see the proposed diff without saving. An applied edit includes the read-back diff and new token. Analyze the file afterward.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
editsYesLine edits against the original module body, applied together.
file_pathYesAbsolute path to the Office file.
module_nameYesExisting module to edit.
preview_onlyNoShow the proposed diff without saving.
allow_protectedNoPermit saving a password-protected VBA project. Set true only after the user agrees.
expected_content_tokenYesContent token from the last read; required.
allow_invalidate_signatureNoPermit saving a change that removes the VBA project's digital signature, where applicable. Set true only after the user agrees.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.2.2

TDQS

A4.6/5.0
Behavior5/5

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

Goes well beyond the destructiveHint/idempotentHint annotations: it discloses the concurrency guard (expected_content_token required, refuses stale edits), the non-overlap constraint, that ranges index the original source without the attribute header, that the call saves once, and that an applied edit returns a read-back diff plus a new token. This is exactly the operational detail an agent needs before a destructive mutation.

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 core action and save behavior, then the line-indexing convention, then the edit semantics, then the safety and preview mechanics. Every sentence carries information, though the density is near the upper limit and could be lightly trimmed without loss.

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, concurrency-guarded multi-edit tool with 7 parameters, the description covers indexing model, edit semantics, validation path, staleness protection, and the returned diff/token. With an output schema present it need not enumerate return fields, so nothing material 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 already 100%, so the baseline is 3, but the description adds real semantics: the insertion convention (end_line = start_line - 1), the empty-replacement deletion rule, the 1-based origin against xlide_read_module output minus the attribute header, and the purpose of preview_only and expected_content_token. It adds meaning beyond the schema rather than restating it.

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 set (replaces, inserts, deletes) on a specific resource (an existing VBA module), with the key differentiator 'in one existing VBA module and saves once' separating it from xlide_write_module (full rewrite) and xlide_read_module (read-only). An agent can place it precisely among the module siblings without opening a schema.

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?

Gives clear operating context: batch line-range edits within one existing module, single save, preview_only to validate first, 'Analyze the file afterward' as a follow-up step. It does not explicitly name an alternative (e.g. use write_module to replace a whole module), so it earns 4 rather than 5.

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