Skip to main content
Glama

build_closed_profile

Construct a closed sketch profile from an ordered list of line and arc segments in one call, validating loop closure before drawing to prevent open-loop extrusion failure. Leaves the sketch open for dimensions and relations.

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 provided, the description carries full responsibility. It discloses multiple behavioral traits: loop validation before SW calls, leaving the sketch open, exact mode to prevent drift, fallback behavior, and call atomicity. This is thorough and honest.

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 long but well-structured with bilingual sections, bullet points, and clear examples. It could be slightly more concise, but the complexity of the tool justifies the length. Front-loads key information.

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 6 parameters, nested segment objects, and no output schema, the description covers all necessary aspects: input format, behavior, return shape, notes on atomicity, and related tools. It is complete for an agent to use correctly.

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?

The input schema provides only type and title for parameters (0% schema description coverage). The description compensates fully by explaining each parameter: plane (aliases), segments (detailed format with coordinate examples), close (auto-closing behavior), exact (exact mode vs inference, drift trade-off), name_hint (unused), and variables (parametric evaluation). This adds significant meaning 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?

The description clearly states the tool builds a closed profile from an ordered list of segments in one call, contrasting with creating multiple primitives. It specifies validation, leaving sketch open, and targets specific use cases like the CSWA Tool Block. This distinguishes it from siblings like create_line/create_arc.

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 and references related tools (add_sketch_relation, extrude_sketch). However, it does not explicitly state when to avoid using this tool (e.g., when you need individual primitives or open profiles). The guidance is clear but lacks explicit exclusions.

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/MCP_CAD'

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