Skip to main content
Glama
WilliamSmithEdward

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

Read module

xlide_read_module
Read-onlyIdempotent

Read a VBA module's source as the editor shows it, with optional line ranges and a content token that guards later writes against concurrent changes.

Instructions

The canonical way to read VBA. Returns a module's source as the VBA editor shows it, with the attribute header stripped, plus a content_token. Pass that token back as expected_content_token when you write, and the write is refused if anything changed the module in between. start_line and end_line read a slice of a long module; both are 1-based and inclusive. line_ranges reads several slices in one call, with each pair [first, last] using body line numbers.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
end_lineNoLast line to return. 0 means the end.
file_pathYesAbsolute path to the Office file.
start_lineNoFirst line to return. 0 means the start.
line_rangesNoOptional list of [first, last] inclusive 1-based line ranges.
module_nameYesModule name, matched without case.
include_headerNoInclude the Attribute VB_* header. Off by default: the header is managed for you on write, and editing it by hand is how a module loses its binding to a sheet or a form.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.2.2
    • addedInput schema / properties / line_ranges
      Added value: +{
      +  "anyOf": [
      +    {
      +      "items": {
      +        "items": {
      +          "type": "integer"
      +        },
      +        "type": "array"
      +      },
      +      "type": "array"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Optional list of [first, last] inclusive 1-based line ranges.",
      +  "title": "Line Ranges"
      +}
  2. First observedv0.1.0

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare readOnly/idempotent/non-destructive, so safety is covered. The description adds genuinely non-schema behavior: the attribute header is stripped by default, a content_token is returned, and a write carrying a stale token is refused. It does not describe pagination or output shape, which are partly the output schema's job.

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 purpose, then usage, then token semantics, then line semantics. Four dense sentences with no filler, though the header/token/line content is packed tightly enough that it reads more like documentation than a routing blurb.

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?

With an output schema present, return-value explanation is correctly omitted, and annotations carry the safety profile. The description covers header stripping, the concurrency token, and line-address semantics, leaving only the sibling-differentiation gap (vs xlide_live_read_module) unaddressed.

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 100%, so the baseline is 3, but the description adds real meaning: it clarifies that start_line/end_line are 1-based and inclusive (the schema only says '0 means the start') and that line_ranges uses body line numbers rather than raw file lines. This is more than restating 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?

States a specific verb+resource ('read a module's source') and positions itself as 'the canonical way to read VBA,' which distinguishes it from siblings like xlide_live_read_module and xlide_read_form. An agent can identify the tool without opening the 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 operational context: use start_line/end_line for a slice, line_ranges for several slices, and pass the returned content_token back on a subsequent write for conflict detection. It stops short of naming when NOT to use it versus the co-existing xlide_live_read_module, so routing guidance is implied rather than explicit.

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