Skip to main content
Glama
TommeCAD FreeCAD MCP

TommeCAD FreeCAD MCP

sketch_add_rectangle

Add a rectangle to a FreeCAD sketch from bottom-left and top-right XY coordinates, creating four coincident, horizontal/vertical-constrained lines and returning their geometry indices.

Instructions

Add a rectangle to a sketch (4 lines with coincident + H/V constraints).

(x1,y1) is bottom-left, (x2,y2) is top-right corner.
Returns geometry indices of the 4 lines.

Contract: explicit internal names recommended. Length mm, area mm^2, volume mm^3; field units override defaults. Errors: invalid_arguments, document_not_found, object_not_found, transaction_conflict, operation_failed, execution_timeout; transport failures are possible. Timeout is not cancellation: never blindly retry mutations. Legacy return shape preserved.

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_name": "<sketch_name>",
      "x1": "<x1>",
      "y1": "<y1>",
      "x2": "<x2>",
      "y2": "<y2>"
    },
    "name": "sketch_add_rectangle"
  }
}

Input Schema

NameRequiredDescriptionDefault
x1Yesx1: mm, sketch_local_xy.
x2Yesx2: mm, sketch_local_xy.
y1Yesy1: mm, sketch_local_xy.
y2Yesy2: mm, sketch_local_xy.
doc_nameNoInternal document Name, never Label/path. Omitted/null uses active document (legacy); pass explicitly.
sketch_nameYesInternal object Name in the selected document, never Label; must have the type required by this tool.
constructionNoTrue creates sketch construction geometry; false creates profile geometry.

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.2

TDQS

A3.9/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and largely does: it discloses that the result is 4 constrained lines, the coordinate ordering, the unit contract with field-level override, the enumerated error conditions, and an important non-retry caution for mutations on timeout. It still omits permissions/preconditions (e.g., the target sketch must exist and be editable) and any idempotency statement, so not a 5.

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?

Front-loaded with the verb, resource and geometry outcome in the first sentence, followed by coordinate orientation and return value as short standalone lines. The trailing 'Contract' block is terse and delivers units, errors and the retry caution without padding.

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?

For a mutation tool with no annotations, the definition covers geometry semantics, coordinate system, units, return shape and failure modes, and an output schema exists so return formatting is not the description's job. Missing only preconditions/permissions for the target sketch, which keeps it short of a 5.

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 coverage is 100%, so the baseline is 3, but the description adds genuine meaning the schema lacks: which corner each coordinate pair represents ((x1,y1) bottom-left, (x2,y2) top-right) and the unit/override contract. The remaining parameters (doc_name, sketch_name, construction) get their semantics from the schema rather than the description.

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 concrete verb+resource ('Add a rectangle to a sketch') and goes further by disclosing the resulting geometry (4 lines with coincident + H/V constraints) and a return value summary. It does not, however, distinguish itself from nearby shape-creating siblings such as sketch_add_polygon or sketch_add_line, so an agent must infer the boundary.

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

Usage Guidelines3/5

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

Usage is implied by the name and by 'explicit internal names recommended' plus the coordinate convention, but there is no explicit when-to-use / when-not guidance and no named alternative for creating a rectangle by other means. Adequate minimum, clear gap.

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