Skip to main content
Glama
danielproxd2

MCP_CAD

by danielproxd2

create_sketch_on_face

Anchor a sketch to a body face by selecting it via centroid or intent. Draw geometry and extrude to create features like holes, pockets, or bosses.

Instructions

Croquis sobre cara — start a new sketch on a body face.

Unlike create_sketch (default planes only), this anchors a sketch to a face on an existing body. After this, draw geometry with create_circle / create_rectangle / create_line / create_slot, then close with extrude_sketch / extrude_cut — same as a default-plane sketch.

selector (recommended) — pick the face by INTENT instead of reading list_faces() and copying a centroid, e.g. the top planar face: create_sketch_on_face(selector={"filter": {"geom": "planar", "normal_axis": "+z"}, "sort": {"axis": "z", "dir": "desc"}, "pick": "first"}) Closed schema: filter{geom:planar|cylindrical|conical|spherical|other|any, body, normal_axis:+x/-x/+y/-y/+z/-z, axis:x|y|z + at_mm/tol_mm or min_mm/max_mm, min_area_mm2/max_area_mm2}, sort{axis:x|y|z|area, dir}, pick:all|first|last|int|[int]. Must resolve to EXACTLY ONE face (add pick:'first' or refine if it matches several). Mutually exclusive with face_centroid_mm. The result echoes selector_matched {n, sample_points_mm}.

Args: face_centroid_mm: [x, y, z] coords in mm — the centroid of the target face. Get this from list_faces() — pass the centroid_mm value verbatim. (Omit when using selector.)

Returns: - name: the new sketch's SW-assigned name (e.g., "Croquis5"). - face_centroid_mm: round-trip of the input centroid. - body_name: which body the face belongs to. - sketch_axis_mapping: dict mapping sketch (X, Y) coords to world coords (or None for cylindrical / non-planar faces). Use this to translate sketch-local positions to world coordinates without guessing — closes a real failure mode where the LLM assumed the wrong axis convention and built geometry in the wrong place.

  Schema:
    {
      "sketch_x_world_direction": [x, y, z],  # unit vector
      "sketch_y_world_direction": [x, y, z],  # unit vector
      "sketch_origin_world_mm":  [x, y, z],   # world coords
                                               # of sketch (0,0)
    }

Common autoparts use: counterbore on top of a flange, hole pattern on a bracket's side face, pocket on a sub-face from a previous cut.

Gotcha — extrude direction default after this call: For raised features (hubs, bosses, sello salientes), the next extrude_sketch call needs reverse_direction=True. The default extrudes INTO the body (toward the inward normal — the cut/pocket case). See extrude_sketch's reverse_direction arg.

Gotcha — sketch axis mapping is NOT intuitive on Y-normal faces: For a face with normal +Y or -Y, sketch +Y maps to world ∓Z (opposite sign of the face normal's Y component). Always read sketch_axis_mapping from the response BEFORE drawing geometry whose world position matters — don't assume sketch +Y = world +Z.

Failure modes: - centroid doesn't match any face within 0.01 mm → raises with hint to re-run list_faces. - centroid matches multiple faces → raises listing candidates; tighten the coordinate. - face is hidden / view occluded → IFace2.Select4 returns False; reorient the SW view and retry.

Example — Ø10 hole through the top face of a block: sk = create_sketch_on_face(selector=<top planar face — see above>) # read sk["sketch_axis_mapping"] before placing geometry create_circle(25, 25, 5) extrude_cut(end_condition="through_all")

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
selectorNo
face_centroid_mmNo
Behavior5/5

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

No annotations provided, so description carries full burden. Discloses two methods for specifying face (selector vs face_centroid_mm), return structure with sketch_axis_mapping, failure modes (centroid mismatch, hidden face), and behavioral nuance that extrude_sketch defaults to inward direction. No contradictions with any annotations.

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?

Well-structured with sections (purpose, comparison, args, returns, gotchas, failure modes, example), front-loaded with key info. Length is justified by tool complexity, though some repetition (e.g., gotchas restated) could be trimmed. Slightly verbose but efficient overall.

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 and low schema coverage, description covers all essential aspects: parameters, return values, failure modes, axis mapping, extrusion direction, and an example. Addresses real failure modes (LLM assumption about axes). Comprehensive for a complex geometry tool.

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 description must compensate. It does so extensively: explains selector with closed schema and example, explains face_centroid_mm sourced from list_faces, notes mutual exclusivity, and describes return fields including sketch_axis_mapping schema. Adds meaning far beyond bare 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 creates a sketch anchored to a face on an existing body, and distinguishes it from create_sketch which only works on default planes. The verb 'start a new sketch on a face' is specific and the resource is clearly identified.

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?

Provides explicit when to use (face-based sketch) vs alternative (create_sketch for default planes). Outlines workflow with other tools (create_circle, extrude_sketch) and includes common use cases (counterbore, hole pattern). Also gives gotchas about extrude direction and axis mapping, guiding correct usage.

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