Skip to main content
Glama
TommeCAD FreeCAD MCP

TommeCAD FreeCAD MCP

set_expression

Set or remove a native FreeCAD property expression, recompute the model, and roll back on invalid references, cycles, or failed recomputes.

Instructions

Set/remove a native property Expression, recompute and roll back on failure. Property paths may include components/indexes.

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": {
      "doc_name": "<doc_name>",
      "obj_name": "<obj_name>",
      "property_name": "<property_name>"
    },
    "name": "set_expression"
  }
}

Input Schema

NameRequiredDescriptionDefault
doc_nameYesExplicit internal Name; no Label or active-document fallback.
obj_nameYesExplicit internal Name; no Label or active-document fallback.
expressionNoNative arithmetic expression with units and same-document object/cell/alias references; + - * / ^ and parentheses. No function calls, scripts or external-document expressions. Null removes expression. Invalid references, cycles and failed recomputes cause invalid_expression and rollback.
property_nameYesExplicit internal Name; no Label or active-document fallback.

Output Schema

NameRequiredDescriptionDefault
dataNo
errorNo
statusYes
warningsNo
referencesNo
contract_versionNo1.0

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.2

TDQS

A4/5.0
Behavior5/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 so well: it discloses recompute-plus-rollback-on-failure semantics, enumerates concrete error codes, warns that timeout is not cancellation, and notes transport failures are possible. This is exactly the behavioral context an agent needs before invoking a mutation.

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?

Front-loaded with the action and consequence, then organized into a labelled 'Contract' clause grouping names, units, and errors. Dense but every clause is informative; 'Legacy return shape preserved' is terse to the point of being cryptic.

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?

An output schema exists and the description sensibly does not re-document return values, while it does cover units, name requirements, rollback behavior, and error surface. The only shortfall is the absence of any routing guidance relative to property-setting siblings.

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; the description earns more by adding that property paths may include components/indexes and by stating the unit defaults (mm, mm^2, mm^3) with field-level overrides. It does not clarify the distinction between expression=null and omission, which is the remaining gap.

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 pair and resource: 'Set/remove a native property Expression', plus the recompute/rollback consequence. An agent can distinguish this from generic property or placement setters without opening the schema, though no sibling is named explicitly.

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?

The contract does give operational guidance ('explicit internal names recommended', 'never blindly retry mutations'), which implies when caution is needed. However, it never says when to use this tool versus a sibling such as set_properties, and there are no exclusions or preconditions for choosing it.

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