Skip to main content
Glama

cad_constraint

Add, remove, list, or solve 2D sketch geometric constraints like coincidence, distance, and angle. Solves constraint systems and reports residual error for accurate CAD modeling.

Instructions

Add, remove, list or solve geometric constraints.

按 ``action`` 执行约束操作:add / remove / list / solve。
Adds 2D sketch constraints between entities (e.g. coincidence, distance,
angle). ``solve`` runs the constraint solver and reports residual error;
the optional ``planegcs`` backend is used when installed.

When not to use: ``cad_constraint`` constrains *geometry*; for assembly
mating (parts) use ``cad_assembly`` (action=add_mate/solve). For direct
transforms use ``cad_object`` (action=transform).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
constraintNoConstraint action, discriminated by `action`: add, remove, list or solve.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
typeNoConstraint type
countNoNumber of constraints
actionYesConstraint action
statusYesOperation status
messageNoStatus description
entitiesNoReferenced entity ids
residualNoFinal residual norm
convergedNoWhether the solver converged
iterationsNoSolver iterations used
constraintsNoConstraint records
constraint_idNoConstraint id
moved_entitiesNoMoved entity ids
Behavior4/5

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

Annotations declare readOnlyHint=false, idempotentHint=false, destructiveHint=false, but the description adds useful behavioral context: 'solve runs the constraint solver and reports residual error' and mentions the optional 'planegcs' backend. This goes beyond the annotations by clarifying solve behavior and backend dependency. No contradiction with annotations.

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 description is compact and front-loaded: first sentence states the full purpose, the middle elaborates on solve behavior, and the final section gives exclusions. Every sentence earns its place; no fluff.

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 the tool has a discriminated union with four actions, the description covers all of them, explains when not to use it, mentions the solve backend, and the output schema exists so return values need no explanation. It is complete for the tool's complexity.

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 100%, so the schema already documents parameters well. The description adds extra semantic value by giving constraint type examples (coincidence, distance, angle) and explaining that solve reports residual error, which is not in the schema. This lifts it above the baseline of 3.

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 opens with a specific verb+resource: 'Add, remove, list or solve geometric constraints.' It clearly enumerates all four actions and gives concrete constraint examples (coincidence, distance, angle), distinguishing it from sibling tools like cad_assembly and cad_object by explicitly scoping to geometry.

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?

The description provides explicit 'When not to use' guidance, naming cad_assembly for assembly mating (action=add_mate/solve) and cad_object for direct transforms (action=transform). This directly answers when to use the tool versus alternatives.

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/Tianshang301/TianshangCAD'

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