Skip to main content
Glama
danielproxd2

MCP_CAD

by danielproxd2

build_closed_profile

Build a closed profile sketch from an ordered list of line and arc segments in a single call. Validates loop closure before drawing to prevent extrusion failure.

Instructions

Perfil cerrado — construye un croquis a partir de UNA lista ordenada de segmentos (líneas y arcos) en UNA sola llamada, en vez de ~16 create_line/ create_arc sueltas. Valida que el lazo cierre ANTES de tocar SolidWorks (un perfil abierto mata la extrusión silenciosamente), luego dibuja todo y deja el croquis ABIERTO para que añadas cotas/relaciones y extruyas.

Uso típico CSWA Tool Block: pasa el outline completo (lados + chamfers rectos + arcos R10/R20) como segments; el croquis queda listo para add_sketch_relation / add_sketch_dimension / add_sketch_fillet y luego extrude_sketch.

[en: Closed profile — build a sketch from ONE ordered list of segments (lines + arcs) in a single call instead of ~16 separate primitives. Validates the loop closes BEFORE any SW call (an open loop silently kills the extrude), then draws it and leaves the sketch OPEN to constrain.]

Args: plane: sketch plane ("front"/"top"/"right", Spanish aliases, or a reference-plane name). segments: ordered loop. Each item is either {"type":"line", "x1","y1","x2","y2"} or {"type":"arc", "cx","cy","radius_mm","start_angle_deg", "end_angle_deg","direction"("ccw"|"cw", default "ccw")}. Each segment's end must meet the next segment's start. close: if True (default), auto-add a closing line from the last endpoint back to the first start when there's a gap. If False and the loop isn't closed, raises. name_hint: optional; reserved for future naming. Currently unused. exact: if True (default), draw the loop in SolidWorks' exact mode (ISketchManager.AddToDB) — segments land at their exact input coordinates with NO automatic-relation inference, so the profile does NOT drift 1-3 mm (and mass several %) as SW relaxes inferred relations. This is the fix for the CSWA Tool Block drift: a true-arc profile builds at the exact intended bbox and mass instead of drifting by mm and grams. Pass exact=False ONLY if you deliberately want SW to infer horizontal/vertical/tangent relations for later parametric editing (and accept the drift). Best-effort: if the driver can't toggle exact mode it falls back to inference-on. variables: optional dict para coordenadas paramétricas — cualquier coordenada de segmento puede ser un STRING como "A-29" o "B/2" evaluado contra este dict (solo números, variables, + - * / y paréntesis). Variante nueva = misma llamada con otro variables.

Returns {sketch_name, plane, segment_count, closed, vertices}. The sketch is left OPEN — add relations/dimensions, then extrude_sketch.

NOTE: call-count atomic, not SW-transactional — the up-front loop validation is the guardrail against a half-drawn open profile.

Related: create_sketch + create_line/create_arc (the primitives this composes); add_sketch_relation / add_sketch_dimension (constrain it after).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
closeNo
exactNo
planeYes
segmentsYes
name_hintNo
variablesNo
Behavior5/5

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

With no annotations, the description fully discloses behavior: validates loop closure before SolidWorks call, leaves sketch open, explains exact mode to avoid drift, and notes it's call-count atomic but not SW-transactional. All important traits are covered.

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 lengthy but well-structured with clear sections, bilingual text, and bold headings. It is front-loaded with the core purpose and typical use. Minor redundancy from bilingual text.

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?

Given no output schema, the description explains the return value (dict with sketch_name, plane, etc.) and mentions related tools. All aspects of a complex tool are adequately covered.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0%, so the description carries the full burden. It provides detailed explanations for all 6 parameters, including format, defaults, valid values, and usage notes. The segments parameter is thoroughly described with sub-fields.

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 clearly states it builds a sketch from a single ordered list of segments, distinguishing it from the many separate create_line/create_arc calls. It also emphasizes the validation of loop closure, making the purpose very specific.

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?

The description provides a typical use case (CSWA Tool Block) and contrasts with primitives. However, it does not explicitly state when not to use this tool or list alternatives beyond create_line/create_arc.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/danielproxd2/solidworks-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server