Skip to main content
Glama
SolidWorks MCP Python

SolidWorks MCP Python

by locense

Set Equation

set_equation
Idempotent

Add or change a SolidWorks equation or global variable so one value drives dimensions across configurations, then rebuild the model. Use it for parametric parts and assemblies.

Instructions

Add or change an equation or global variable, so one value drives others (a parametric part).

E.g. Width = 60mm, then D1@Sketch1 = "Width" / 2: changing Width later resizes the sketch. A name with @ is a dimension of the active document (list_model_dimensions); any other is a global variable. An existing equation for name is changed, else one is added; the model is solved and rebuilt. Applies in all configurations unless configurations says otherwise. An expression SolidWorks can't use fails as equation_refused, changing nothing. Needs: an open part or assembly. Changes: the equation and what it drives. Returns: equation with name, expression, kind, value (document units), action (added or changed) and configurations.

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

Input Schema

NameRequiredDescriptionDefault
input_dataYes`name` and `expression` are required; `configurations` defaults to `all`.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.4/5.0
Behavior5/5

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

Beyond the annotations, the description discloses model rebuilding, configuration scope, failure behavior (`equation_refused` with no changes), prerequisites, and exactly what state changes. These are meaningful behavioral details for a mutation tool.

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?

The description is front-loaded and organized, with examples and failure behavior placed early. It includes return-value details that are somewhat redundant because an output schema exists, but the overall structure remains clear and efficient.

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 mutation tool with configuration scope and rebuild side effects, the description covers prerequisites, failure modes, state changes, and defaults. With an output schema also present, it provides more than enough context for correct 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?

The schema already documents all parameters at 100% coverage, including the `@` dimension naming, expression syntax, and configuration scoping. The description reinforces this but adds little parameter-level meaning beyond what the structured schema already provides.

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 begins with a specific verb and resource: add or change an equation or global variable. It explains the parametric driving use case and gives concrete examples, making it clearly distinguishable from sibling tools such as delete_equation or set_dimension.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

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

It gives clear context for when to use the tool, including prerequisites (an open part or assembly) and the distinction between global variables and dimensions. It stops short of explicitly contrasting with alternatives like set_dimension or delete_equation, so it is strong but not complete routing guidance.

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