Skip to main content
Glama
SolidWorks MCP Python

SolidWorks MCP Python

by locense

Generate VBA: Drawing Views

generate_vba_drawing_views
Read-onlyIdempotent

Generates VBA macro code to place a model's standard front, top, and right views on the active SolidWorks drawing; returns the code for the VBA editor.

Instructions

Write a VBA macro that places a model's standard views (front, top, right) on the active drawing.

To make a drawing directly, use generate_drawing_package or create_drawing_view. 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_drawing_views"
  }
}

Input Schema

NameRequiredDescriptionDefault
input_dataYesThe views. Give `model_path` (the model to draw); `scale`, `sheet_format` and the view layout have defaults. The drawing must be open and active when the macro runs.

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 and destructiveHint=false, and the description reinforces this with 'Read-only. Nothing runs in SolidWorks.' Beyond that it discloses genuinely non-obvious behavior: the artifact is text destined for the VBA editor (Alt+F11), and the execution path via execute_macro is blocked by file-format constraints. It stops short of describing practical limits such as macro length or required SolidWorks permissions.

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 sentences, front-loaded with the core action, followed by alternatives, execution caveats, and return keys. The trailing 'Returns:' line slightly duplicates the output schema but is inexpensive and useful as a quick scan. Little wasted wording.

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?

For a tool with an output schema and full annotation coverage, the description covers the essentials: what is produced, how it is consumed, what it must not be confused with, and the precondition on the active drawing. Minor gap: nested advanced_options and view_layout remain unexplained beyond their schema names.

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?

With 100% schema description coverage the schema already defines all eight nested fields, so the baseline is 3. The description adds prioritization ('Give model_path'), notes which fields default (scale, sheet_format, view layout), and adds a runtime precondition — 'The drawing must be open and active when the macro runs' — that the schema does not express.

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 description opens with a specific verb and resource: 'Write a VBA macro that places a model's standard views (front, top, right) on the active drawing.' It also names the sibling tools it is not (generate_drawing_package, create_drawing_view), so an agent can separate macro-generation from direct drawing creation 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 gives explicit routing: 'To make a drawing directly, use generate_drawing_package or create_drawing_view,' and states why a sibling cannot substitute — 'execute_macro runs only binary .swp files, so it can't run this directly.' Both the when-to-use and the when-not-to-use case are spelled out.

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