Skip to main content
Glama

Add Spring

add_spring

Add a helical compression spring to a FreeCAD model by specifying wire diameter, outer diameter, free length, and coils; returns geometry and steel spring rate for mechanism sizing.

Instructions

Add a helical compression spring: a round wire swept along a cylindrical helix.

All lengths in mm; angles n/a. wire_diameter: wire (stock) diameter d, mm. outer_diameter: spring outer diameter OD, mm (must be > wire_diameter). free_length: uncompressed overall length along the axis, mm. coils: number of turns (active coils), may be fractional. kind: 'compression' (only supported mode in v1; end coils are not squared yet). placement: optional [x, y, z] mm translation of the spring's base.

Geometry: mean coil diameter D = outer_diameter - wire_diameter; coil pitch = free_length / coils. Spring rate is computed for STEEL (shear modulus G = 79.3 GPa) as k = Gd^4 / (8D^3*coils), reported in N/mm.

Returns {handle, name, volume (mm^3), mean_diameter (mm), free_length (mm), coils, kind, solid_height (mm, = coils*wire_diameter, the fully-compressed block height), spring_rate_n_per_mm (N/mm)}. Use free_length, solid_height and spring_rate_n_per_mm to spec the spring into a mechanism (available travel = free_length - solid_height; force = spring_rate_n_per_mm * deflection).

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": {
      "wire_diameter": "<wire_diameter>",
      "outer_diameter": "<outer_diameter>",
      "free_length": "<free_length>",
      "coils": "<coils>"
    },
    "name": "add_spring"
  }
}

Input Schema

NameRequiredDescriptionDefault
kindNocompression
nameNoSpring
coilsYes
placementNo
workspaceNoRun this call in this named workspace
free_lengthYes
wire_diameterYes
outer_diameterYes

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

A4.4/5.0
Behavior5/5

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

Beyond the annotations (which only cover the safety profile), the description discloses the hard-coded STEEL assumption with G = 79.3 GPa, the exact spring-rate formula, the un-squared end-coil caveat, and the derived geometry relations. The material assumption in particular is a behavior an agent could not otherwise know and would materially affect downstream calculations.

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 a one-line definition, then a clean parameter block, geometry block, and return block — well structured and dense. Minor waste: 'angles n/a' reads as a leftover template artifact and the return list partially repeats what the geometry section already implies.

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?

With no output schema, the description correctly spells out the return object and even the mechanism-design formulas, and it flags the v1 mode restriction. What it omits is where the spring lands — active document requirement, whether it creates a new body or a feature — which an agent needs to sequence this call correctly.

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

Parameters5/5

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

Schema description coverage is only 13%, so the description must compensate, and it does: it defines wire_diameter, outer_diameter (with the must-be-greater constraint), free_length, coils (may be fractional), kind, and placement units for six of eight parameters, plus derived quantities D and pitch. Only name and workspace are left to the schema, and workspace already carries its own description.

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?

States a specific verb and resource with precise scope: 'Add a helical compression spring: a round wire swept along a cylindrical helix.' This distinguishes it cleanly from generic geometry siblings like helix, sweep, or add_primitive, and from the analysis-side sibling spring_check.

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?

It states the v1 limitation ('kind: compression only supported mode') and suggests using the returned values to 'spec the spring into a mechanism', which is output-usage guidance rather than selection guidance. It never says when to prefer this over helix+sweep for a custom spring, nor points to spring_check for validation, so the agent must infer the boundary.

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