Skip to main content
Glama
SolidWorks MCP Python

SolidWorks MCP Python

by locense

Generate VBA: Insert Component

generate_vba_assembly_insert
Read-onlyIdempotent

Generate VBA macro code that inserts a component into the active SolidWorks assembly at a specified point and rotation for pasting into the VBA editor; no code runs.

Instructions

Write a VBA macro that inserts a component into the active assembly at a point.

To insert a component directly, use insert_component. 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_assembly_insert"
  }
}

Input Schema

NameRequiredDescriptionDefault
input_dataYesThe component. Give `component_path` (the .sldprt or .sldasm); `insertion_point` and `rotation` default to the origin.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint and destructiveHint=false, so "Read-only. Nothing runs in SolidWorks" is partly redundant, but the description adds genuinely new behavioral facts: the macro is returned as text for the SolidWorks VBA editor (Alt+F11) and cannot be run by `execute_macro`. It also names the return fields, which goes beyond the annotation set.

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?

Four short, front-loaded paragraphs: action first, sibling routing second, execution caveat third, return values last. Tight overall, with mild redundancy in "Read-only. Nothing runs in SolidWorks" restating the readOnlyHint annotation.

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?

An output schema exists and the description still summarizes the returned fields (`vba_code`, `parameters`, `usage_instructions`), and the nested input object is well covered by the schema plus the prose about defaults. Minor residual gaps remain around how the alias parameter relates to the path parameter and what coordinate units are expected.

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, and the description still adds meaning: it tells the agent to supply `component_path` (the .sldprt or .sldasm) and that `insertion_point` and `rotation` default to the origin. It does not clarify the distinction between `component_file` (alias) and `component_path`, or the units for the insertion point, which keeps it below a 5.

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 that inserts a component into the active assembly at a point") and immediately distinguishes itself from the sibling that performs the action directly. An agent can tell the difference between this generator and `insert_component` without opening either schema.

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?

Explicitly names the alternative ("To insert a component directly, use `insert_component`") and states the exclusion that matters most here: `execute_macro` runs only binary .swp files, so this generated text cannot be executed by it. When-to-use, when-not-to-use, and the alternative are all present.

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