Skip to main content
Glama
SolidworksMCP-python

SolidworksMCP-python

execute_macro

Run binary SolidWorks macros (.swp or legacy .swb) through COM to automate CAD tasks; rejects VBA source files and requires non-interactive macros.

Instructions

Run a binary SolidWorks macro (.swp, or legacy .swb).

Calls ISldWorks::RunMacro2 on macro_path (or macro_file). Only binary macros run: VBA source (.vb, .bas, plain text) is rejected as invalid_input before anything reaches SolidWorks. The macro must not be interactive (no MsgBox or user forms).

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "input_data": "<input_data>"
    },
    "name": "execute_macro"
  }
}

Input Schema

NameRequiredDescriptionDefault
input_dataYesThe input data value.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv1.5.0
    • changedInput schema / properties / input_data / properties / macro_file / description
      Previous value: -"Alternative macro file path"New value: +"Alternative to macro_path (.swp or .swb)"
    • changedInput schema / properties / input_data / properties / macro_path / description
      Previous value: -"Path to macro file (.swp or .vb)"New value: +"Path to a binary SolidWorks macro (.swp, or legacy .swb). VBA source (.vb, .bas, text) cannot be run directly."
  2. First observedv1.0.0

TDQS

A3.7/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does add real behavioral detail: the underlying RunMacro2 call, that VBA source is rejected with an 'invalid_input' error before reaching SolidWorks, and that MsgBox/user forms will fail. It omits that the macro can mutate or destroy the open model and doesn't describe blocking/timeout behavior, which matters for arbitrary-code execution.

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 short sentences, front-loaded with the core action and the file-format constraint. Nothing is redundant or padded; each sentence adds a distinct constraint.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The output schema covers return values, so that gap is acceptable. However, for a tool that executes arbitrary user code with zero annotations, the description should warn about side effects on the active document and clarify how repeat_count/parameters interact; those omissions leave an agent under-informed before invoking it.

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 macro_path, macro_file, repeat_count, and the rest. The description only restates the .swp/.swb format constraint and says nothing about the meaning of repeat_count, pause_between_runs, execution_mode, or parameters — several of which remain vague in the schema itself.

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?

States a specific verb+resource ('Run a binary SolidWorks macro') and pins the accepted formats (.swp, legacy .swb), which implicitly separates it from siblings like generate_vba_code or analyze_macro. It never names an alternative tool explicitly, so sibling differentiation is inferred rather than stated.

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?

The preconditions are clear — input must be a compiled binary macro and must be non-interactive — but there is no guidance on when to choose this over batch_execute_macros, execute_workflow, or generate_vba_code. Usage is implied by the input constraints rather than spelled out as a decision rule.

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

Deploy Server

Other Tools