Skip to main content
Glama
SolidWorks MCP Python

SolidWorks MCP Python

by locense

Add Sketch Rectangle

add_rectangle

Draw a closed, axis-aligned rectangle in the open sketch from two opposite corners in mm, for blocks, plates, and rectangular cut-outs. Returns id, width, height, and area.

Instructions

Draw a closed, axis-aligned rectangle in the open sketch from two opposite corners, in mm.

Use it for blocks, plates and rectangular cut-outs. Needs: an open sketch (create_sketch). Changes: adds four connected lines. Returns: rectangle with id, corner1, corner2, width, height and area. Its id is what add_sketch_constraint and add_sketch_dimension take.

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

Input Schema

NameRequiredDescriptionDefault
input_dataYesThe rectangle. Give `x1`, `y1`, `x2`, `y2` (mm; or `corner1_x` ... `corner2_y`); `construction` is off.

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?

Goes well beyond the annotations (readOnlyHint=false, idempotentHint=false, destructiveHint=false) by disclosing the side effect ('adds four connected lines'), the environmental prerequisite (open sketch), and the downstream chaining contract ('Its `id` is what `add_sketch_constraint` and `add_sketch_dimension` take'). That chaining hint materially changes how an agent sequences calls and is not derivable from the schema or annotations.

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-loads the one-sentence definition, then uses explicit 'Use it for / Needs / Changes / Returns' labels that let an agent scan for the needed fact. No filler sentences and nothing redundant with the schema beyond a short return-value recap.

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?

Given a single nested-object parameter, full schema descriptions, and an output schema, the definition covers purpose, prerequisite, side effects, and the return contract well. Minor gaps remain: behavior when no sketch is open and the interaction with `from_center` are unstated, though the output schema carries the return-value detail.

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 coverage is 100% and every field already documents itself, so the schema does the heavy lifting and the baseline of 3 applies. The description adds the framing of 'two opposite corners' and repeated mm units, but it never mentions the `from_center` mode, the `construction` flag, or the corner1_x-style aliases, so it does not enrich the parameter model beyond the schema.

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 — 'Draw a closed, axis-aligned rectangle in the open sketch from two opposite corners, in mm' — including the axis-aligned constraint and units. An agent can distinguish this from add_line, add_circle, or add_ellipse purely from this sentence.

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?

Gives concrete use cases ('blocks, plates and rectangular cut-outs') and a hard prerequisite ('Needs: an open sketch (`create_sketch`)'), which is exactly the gating condition an agent needs. It stops short of naming an alternative approach (e.g., four add_line calls) or exclusion cases, so it is clear context rather than full when/when-not 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