Skip to main content
Glama
SolidworksMCP-python

SolidworksMCP-python

Generate VBA: Drawing Dimensions

generate_vba_drawing_dimensions
Read-onlyIdempotent

Generates a VBA macro that adds a dimension to selected SolidWorks drawing entities and sets its precision for manual insertion into the VBA editor.

Instructions

Write a VBA macro that adds a dimension to the selected drawing entities and sets its precision.

To bring the model's dimensions into a drawing directly, use insert_model_dimensions. 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 entities must be selected 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_drawing_dimensions"
  }
}

Input Schema

NameRequiredDescriptionDefault
input_dataYesA mapping with `dimension_type` ("linear", the default, "radial", "angular" or "diameter") and `precision` (decimal places, default 2).

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 `dimension_type` (\"linear\", the default,\n\"radial\", \"angular\" or \"diameter\") and `precision` (decimal places,\ndefault 2)."
  2. First observedv1.0.0

TDQS

A4.7/5.0
Behavior5/5

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

Beyond the readOnlyHint/idempotentHint annotations, it explains the concrete mechanics: the result is VBA text for the SolidWorks editor (Alt+F11) rather than an executed action, and nothing runs in SolidWorks. The selection prerequisite and the shape of the returned payload are details the annotations cannot convey.

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?

The purpose is stated first, then the alternative, then the execution caveat, then the return payload. Every sentence carries distinct information with no repetition or filler.

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, all decision-relevant context is present: what it produces, how it must be consumed, the selection prerequisite, and which sibling to use instead. Nothing an agent needs to call it correctly is missing.

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 `input_data` mapping already documents `dimension_type` values and the `precision` default. The description only echoes "sets its precision" and adds no format or constraint detail beyond the schema, so the baseline 3 applies.

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?

The opening sentence gives a specific verb and resource: "Write a VBA macro that adds a dimension to the selected drawing entities and sets its precision." It also names the sibling it is not (`insert_model_dimensions`), so an agent can separate the two 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?

It explicitly routes the agent to `insert_model_dimensions` when the goal is pulling model dimensions into a drawing, and rules out `execute_macro` because that tool only handles binary .swp files. It also states the precondition that entities must be selected before the macro runs.

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