Skip to main content
Glama

Add Sketch Constraint

add_sketch_constraint

Add geometric or dimensional constraints to a FreeCAD sketch to control edge, vertex, and center relationships and set numeric values.

Instructions

Add a constraint to a sketch.

type: Coincident, Horizontal, Vertical, Distance, DistanceX, DistanceY, Radius, Diameter, Equal, Parallel, Perpendicular, Tangent, Block, Symmetric, Angle. refs: list of [geom_idx, vertex_role] pairs. vertex_role: 0=edge, 1=start, 2=end, 3=center. value: numeric value (mm or radians) for dimensional constraints.

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": {
      "sketch": "<sketch>",
      "type": "<type>",
      "refs": "<refs>"
    },
    "name": "add_sketch_constraint"
  }
}

Input Schema

NameRequiredDescriptionDefault
refsYes
typeYes
valueNo
sketchYes
workspaceNoRun this call in this named workspace

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.5.7
    • addedInput schema / properties / workspace
      Added value: +{
      +  "default": "",
      +  "description": "Run this call in this named workspace",
      +  "title": "Workspace",
      +  "type": "string"
      +}
  2. First observed

TDQS

B3.1/5.0
Behavior2/5

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

Annotations declare readOnlyHint=false and destructiveHint=false, so the write nature is already known. The description adds only the units convention (mm or radians), which is useful, but says nothing about state requirements (sketch must be in edit mode), what happens on an inconsistent or over-constrained set of refs, or whether the sketch is modified in place versus requiring a transaction commit.

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 one-line purpose is front-loaded, followed by terse field notes with no filler sentences. The content is dense and useful; the leading blank line and lack of formatting polish keep it just under a 5.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 5-parameter mutation tool with no output schema, the description covers the three most complex parameters well but leaves sketch identification and error/return behavior undocumented. It is usable but not complete enough for an agent to invoke confidently on the first try.

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

Parameters4/5

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

Schema description coverage is only 20% (just workspace), so compensation is required and largely delivered: the description documents the full type enum, explains refs as [geom_idx, vertex_role] pairs with the four vertex_role codes, and gives value units. The sketch parameter itself is never explained (name? index? handle?), leaving one required parameter unaddressed.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/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 constraint to a sketch") and enumerates the full set of constraint types, so an agent knows what operation is being performed. It does not distinguish this tool from siblings like add_sketch_geometry or add_sketch_external, which an agent must infer from names alone.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There is no guidance on when to use this versus the other sketch-building tools, and no stated preconditions such as requiring an open sketch or an existing sketch edit session. The agent must guess the workflow ordering (open sketch → add geometry → add constraints → close_sketch).

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