Skip to main content
Glama
SolidWorks MCP Python

SolidWorks MCP Python

by locense

Generate VBA: Part Modeling

generate_vba_part_modeling
Read-onlyIdempotent

Creates VBA macro text for shelling or filleting the active SolidWorks part, returning code and parameters for the VBA editor without running SolidWorks.

Instructions

Write a VBA macro for a shell or a fillet on the active part.

Use it for a shell, which no direct tool makes yet; for a fillet, add_fillet works directly. The macro comes back as text for the SolidWorks VBA editor (Alt+F11); execute_macro runs only binary .swp files, so it can't run this directly. Read-only. Nothing runs in SolidWorks. Returns: vba_code, the parameters used and usage_instructions.

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": "generate_vba_part_modeling"
  }
}

Input Schema

NameRequiredDescriptionDefault
input_dataYesA mapping with `operation`, "shell" (the default, with `thickness` in mm, default 2) or "fillet" (with `radius` in mm, default 5). Any other operation is refused.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.6/5.0
Behavior5/5

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

Annotations cover read-only/idempotent/non-destructive, but the description adds critical behavior annotations cannot express: nothing executes in SolidWorks, the result is text pasted into the VBA editor via Alt+F11, and the sibling executor cannot run it. It also names the return fields, closing the loop on what the agent gets back.

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 action and scope, then the routing rule, then the execution-channel caveat. The trailing 'Returns:' list is mild redundancy given an output schema exists, but it is short and every earlier sentence carries real decision value.

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 single-parameter generator with an output schema and full annotations, this covers everything an agent needs: what it produces, what it will not run, and how the artifact is consumed. No gaps remain that would cause a wrong invocation.

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% and the schema already documents the `operation` values with their default thickness and radius, so the description adds little parameter detail. The default-vs-alternative framing ('shell is the default', 'any other operation is refused' per schema) is already structured data; the description does not restate it, leaving baseline 3 appropriate.

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 ('Write a VBA macro') scoped to 'a shell or a fillet on the active part'. The scope statement cleanly separates it from direct-geometry siblings like add_fillet and from other generate_vba_* generators.

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?

Explicit routing: use this for shell because no direct tool exists, use add_fillet for fillets, and execute_macro cannot run the output because it only takes binary .swp files. Both the when-to-use and when-not-to-use cases are named with the alternative.

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