Skip to main content
Glama
TommeCAD FreeCAD MCP

TommeCAD FreeCAD MCP

sketch_add_line

Add a straight line segment between two sketch-local XY points, optionally as construction geometry, and return the new geometry index.

Instructions

Add a line segment to a sketch. Returns geometry index.

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

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.5/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 does substantial work: it discloses the return value, the unit contract with field-level override precedence, an enumerated error taxonomy, and a genuine behavioral warning that timeouts are not cancellations and mutations should not be blindly retried. It stops short of saying whether the call requires an active document or edit session, and what state is left behind on operation_failed.

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 core action and return value are front-loaded in one sentence, followed by a compact "Contract:" block. The error enumeration is somewhat generic boilerplate, but nothing is redundant enough to obscure the call.

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?

An output schema exists, so return-shape explanation is optional, and the error/timeout notes cover failure handling well. However, for a mutation tool with zero annotations, the description omits prerequisite state (active document, sketch edit context) and whether the sketch must already exist versus being created implicitly, leaving gaps a caller must discover.

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 already 100%, so the baseline is 3, but the description adds meaning beyond the schema by stating the global unit defaults (mm, mm^2, mm^3) and that per-field units override them — a precedence rule the schema does not encode. The "explicit internal names recommended" note largely restates the doc_name/sketch_name schema text, limiting the upside.

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?

The first sentence gives a specific verb and resource ("Add a line segment to a sketch") plus the return value ("geometry index"). It is naturally distinguishable from siblings like sketch_add_arc, sketch_add_circle, or sketch_add_rectangle because the geometry type is named, though no sibling is called out explicitly.

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?

The description never says when to prefer this over sketch_add_rectangle, sketch_add_polygon, or constraint tools, nor does it state prerequisites such as the sketch needing to be open in edit mode. The only guidance is a naming recommendation ("explicit internal names recommended"), which is a parameter convention rather than usage routing.

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