Skip to main content
Glama
SolidworksMCP-python

SolidworksMCP-python

Add Sketch Relation

add_sketch_constraint

Add geometric relations between sketch entities to hold design intent, then verify definition with check_sketch_fully_defined.

Instructions

Add a geometric relation between sketch entities: horizontal, vertical, parallel, perpendicular, tangent, coincident, concentric, equal, symmetric, collinear or fix.

Use it to hold design intent, then check with check_sketch_fully_defined. Entities are the ids the add_* tools returned. Needs: an open sketch (create_sketch). Changes: adds the relation. Returns: constraint with id, type and the entities.

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_sketch_constraint"
  }
}

Input Schema

NameRequiredDescriptionDefault
input_dataYesThe relation. `entity1` and `relation_type` are required; `entity2` when the relation needs two, and `entity3` (the centreline) only for symmetric.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv2.2.0
    • changedInput schema / properties / input_data / properties / entity1 / description
      Previous value: -"First entity name or ID"New value: +"First entity: an ID from add_line/add_arc/..., '<id>.start' or '<id>.end' for a line's or arc's end point, or 'origin'"
    • changedInput schema / properties / input_data / properties / entity2 / description
      Previous value: -"Second entity name or ID (if required)"New value: +"Second entity, the same kinds (if required); e.g. 'Line_1.start' coincident with 'origin' ties a corner to the origin"
  2. Changed1 schema field changedv2.0.0
    • changedInput schema / properties / input_data / description
      Previous value: -"The input data value."New value: +"The relation. `entity1` and `relation_type` are required;\n`entity2` when the relation needs two, and `entity3` (the\ncentreline) only for symmetric."
  3. First observedv1.0.0

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=false, idempotentHint=false, and destructiveHint=false, so the mutation profile is known; the description adds what the caller must have in place (an open sketch) and confirms the effect is additive rather than destructive. It does not mention what happens on duplicate or conflicting relations, which matters for a non-idempotent write.

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?

The relation list is front-loaded, and the Needs/Changes/Returns structure packs prerequisites, effect, and result into a short block with essentially no filler.

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?

With a full schema, an output schema, and annotations present, the description covers what an agent needs: supported relations, required sketch state, effect, and return shape. The only real gap is failure behavior (duplicate/conflicting relations) for a non-idempotent write.

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%, so entity1/entity2/entity3/relation_type are already fully documented, including the symmetric-only rule for entity3. The description only adds the provenance hint that entities are "the `id`s the add_* tools returned," which is useful but marginal against a complete 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 ("Add a geometric relation between sketch entities") and enumerates the exact relation types supported, so an agent can distinguish it from add_sketch_dimension or sketch_mirror without opening the schema.

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 a clear use case ("hold design intent") and a follow-up verification path ("check with `check_sketch_fully_defined`"), plus the prerequisite of an open sketch via `create_sketch`. It stops short of explicit when-not guidance or naming which sibling to use for non-relational constraints like dimensions.

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