Skip to main content
Glama
SolidworksMCP-python

SolidworksMCP-python

Generate VBA: Assembly Mates

generate_vba_assembly_mates
Read-onlyIdempotent

Generate VBA macro code to add concentric, distance, parallel, perpendicular, or coincident assembly mates between selected faces or edges in SolidWorks.

Instructions

Write a VBA macro that adds a concentric, distance, parallel, perpendicular or coincident mate between two selected faces or edges.

To add a mate directly, use add_mate. 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. The faces must be selected in SolidWorks before the macro runs. 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_mates"
  }
}

Input Schema

NameRequiredDescriptionDefault
input_dataYesA mapping with `mate_type` (default "concentric"), `component1` and `component2` (names, for the comments), and `distance` in mm for a distance mate.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv2.0.0
    • changedInput schema / properties / input_data / description
      Previous value: -"The input data value."New value: +"A mapping with `mate_type` (default \"concentric\"),\n`component1` and `component2` (names, for the comments), and\n`distance` in mm for a distance mate."
  2. First observedv1.0.0

TDQS

A4.7/5.0
Behavior4/5

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

Annotations already declare readOnlyHint/idempotentHint, but the description adds meaningful context beyond them: output is text destined for the VBA editor (Alt+F11), nothing executes inside SolidWorks, and the macro requires pre-selected faces. 'Read-only. Nothing runs in SolidWorks.' partially restates the annotations, which keeps this from a 5.

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?

Front-loaded with the core action, then a compact block of constraints and return values. No filler sentences; every line carries actionable information.

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?

Despite a nested input object and an output schema, the description covers preconditions, alternative tools, execution limitations, and return keys. Nothing an agent needs to invoke it correctly is missing.

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 nested input_data fields are documented, but the description adds the enumerable mate types (concentric, distance, parallel, perpendicular, coincident) that the schema does not list, plus clarifies that component1/component2 only feed comments. Useful enrichment above the baseline 3.

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 artifact ('Write a VBA macro') plus the exact operation and supported mate types, and distinguishes itself from add_mate in the same breath. An agent can tell what it produces (VBA text) 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 Guidelines5/5

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

Explicitly routes the agent: 'To add a mate directly, use add_mate', and explains that execute_macro cannot run the result because it only handles binary .swp files. It also states the precondition that faces must be selected in SolidWorks first.

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