Skip to main content
Glama
WilliamSmithEdward

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

Point a shape at a macro

xlide_set_shape_macro
DestructiveIdempotent

Reassign a shape or button's click macro in Excel and save the workbook. Use an empty macro to clear the link. Ensure the Sub exists before setting.

Instructions

Changes which macro an existing shape or button runs when clicked, and saves the workbook. An empty macro clears the link. Use it after writing a Sub, so a button actually calls it, and after renaming one, because nothing rewrites an OnAction. Give the procedure as Proc or Module.Proc; it must already exist in the project, so write it first. To add a button with its macro, or to remove one, use xlide_manage_shape.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
macroYesThe procedure to run, as Proc or Module.Proc. Empty clears the link.
sheetYesWorksheet the shape is on.
file_pathYesAbsolute path to the Excel file.
shape_nameYesShape name, as xlide_list_shapes reports it.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.9/5.0
Behavior5/5

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

Annotations already mark this as destructive and non-read-only, and the description adds meaningful behavioral detail: it saves the workbook, an empty macro clears the link, and renaming a procedure does not automatically rewrite the OnAction. This goes well beyond the structured annotations.

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?

Four tightly packed sentences, all earning their place: core action, key edge case, usage triggers, and sibling routing. No filler or repetition of obvious schema metadata.

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 all four parameters required, the description covers what it does, side effects, prerequisites, valid input format, and when to choose a sibling. Nothing essential is missing for an agent to call it correctly.

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. The description adds extra meaning by emphasizing that the procedure must already exist in the project and that it should be written first, plus explains the Proc-or-Module.Proc format in context. This is useful beyond the schema 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?

States a specific verb and resource: changes the macro an existing shape or button runs when clicked, and also notes that it saves the workbook. It explicitly distinguishes itself from xlide_manage_shape by saying that adding or removing a button belongs to that sibling.

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

Usage Guidelines5/5

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

Gives concrete when-to-use scenarios: after writing a Sub and after renaming a procedure. It also gives an explicit when-not-to-use rule and names the alternative tool, xlide_manage_shape, for adding or removing buttons.

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