Skip to main content
Glama

Run Structural FEA

run_fea

Use this when you need to know whether a part will hold a load. Runs the linear-static structural study a script declares with shape.feaStudy({ material, fixed, loads, meshSize?, minSafetyFactor? }): meshes the solid with quadratic tetrahedra, solves it with CalculiX, and returns evidence — peak von Mises stress (MPa), peak displacement (mm), the minimum safety factor against the material yield (taken away from the clamp-singular edges of the fixed faces; the raw clamp-edge peak is reported separately as peakAtSupportMPa), per-region hot spots named by @kc[...] face ref, mesh-quality trust flags, an equilibrium residual, and stress-heatmap PNG paths. Requires the external solver toolchain (CalculiX ccx plus the gmsh Python module). When it is absent the call fails with fea.solver.unavailable and the exact install command — never a silent pass. Pass { file | code }, optional study (defaults to the last declared study), output_dir (keeps the .inp/.frd deck for reproduction), mesh_size (mm, overrides the study for this run), and heatmaps: false for a fast numbers-only run. Mesh refinement is automatic: when the stress is untrusted only because the solver's error estimate is high, it re-solves once at 0.75x the element size (when the predicted element count fits the element budget) and returns that pass, with summary.refinement listing each pass's mesh size, element count and peak stress and why it stopped. refine: false solves once at mesh_size.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeNoInline kernelCAD script source (mutually exclusive with file).
fileNoPath to a .kcad.ts script declaring at least one feaStudy. Hosted server: cannot read files from your machine — pass `code`, or `project:<slug>` for a saved project.
studyNoName of the study to run; defaults to the last declared one.
refineNoOne automatic finer pass (0.75x element size) when the stress is untrusted, inside the element budget (default true). false: one solve at mesh_size.
heatmapsNoRender stress heatmap PNGs (default true).
mesh_sizeNoTarget element size in mm, overriding the study for this run.
output_dirNoDirectory for the solver deck, results, summary JSON and heatmap PNGs.
mesh_timeout_msNoWall-clock budget for meshing (default 120000).
solve_timeout_msNoWall-clock budget for the solve (default 300000).

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • removedOutput schema / properties
      Removed value: -{
      -  "artifacts": {
      -    "additionalProperties": true,
      -    "description": "Absolute paths of the BREP geometry handoff, .inp deck, .frd results and mesh JSON, for hand reproduction.",
      -    "type": "object"
      -  },
      -  "diagnostics": {
      -    "description": "fea.* diagnostics raised by the run.",
      -    "items": {
      -      "additionalProperties": true,
      -      "type": "object"
      -    },
      -    "type": "array"
      -  },
      -  "error": {
      -    "type": "string"
      -  },
      -  "errorCode": {
      -    "type": "string"
      -  },
      -  "images": {
      -    "description": "Absolute PNG paths of the rendered stress heatmap.",
      -    "items": {
      -      "type": "string"
      -    },
      -    "type": "array"
      -  },
      -  "legend": {
      -    "description": "Heatmap colour bands { color, fromMPa, toMPa } — the scale the PNGs are drawn on.",
      -    "items": {
      -      "additionalProperties": true,
      -      "type": "object"
      -    },
      -    "type": "array"
      -  },
      -  "ok": {
      -    "description": "False when the study violated its declared minSafetyFactor, a selector did not resolve, or the solver toolchain is missing.",
      -    "type": "boolean"
      -  },
      -  "out_dir": {
      -    "description": "Directory holding the summary JSON, solver deck and heatmap PNGs.",
      -    "type": "string"
      -  },
      -  "summary": {
      -    "additionalProperties": true,
      -    "description": "Solved evidence: maxVonMisesMPa, maxVonMisesAt, maxDisplacementMm, maxDisplacementAt, minSafetyFactor (+ minSafetyFactorRequired), nodeCount/elementCount/meshSizeMm, quality (minSICN, meanSICN, lowQualityCount), maxStressErrorPercent (high-stress region), trust { meshTrusted, reasons }, hotSpots [{ region, maxVonMisesMPa, nodeId, at, safetyFactor }]; the stress values, safety factor and hot spots exclude the support zone next to fixed-face edges (governingField), whose clamp-singular raw peak is reported as peakAtSupportMPa / peakAtSupportAt / peakAtSupportRegion with supportAdjacentNodeCount and supportZoneRadiusMm; appliedForceN / reactionForceN / equilibriumResidual, meshMs / solveMs.",
      -    "type": "object"
      -  }
      -}
    • removedOutput schema / required
      Removed value: -[
      -  "ok"
      -]
  2. Changed1 schema field changed
    • changedInput schema / properties / refine / description
      Previous value: -"Automatic mesh refinement until the stress is trusted, inside the element and wall-time budgets (default true). false: one solve at mesh_size."New value: +"One automatic finer pass (0.75x element size) when the stress is untrusted, inside the element budget (default true). false: one solve at mesh_size."
  3. Changed1 schema field changed
    • addedInput schema / properties / refine
      Added value: +{
      +  "description": "Automatic mesh refinement until the stress is trusted, inside the element and wall-time budgets (default true). false: one solve at mesh_size.",
      +  "type": "boolean"
      +}
  4. Changed1 schema field changed
    • changedOutput schema / properties / summary / description
      Previous value: -"Solved evidence: maxVonMisesMPa, maxVonMisesAt, maxDisplacementMm, maxDisplacementAt, minSafetyFactor (+ minSafetyFactorRequired), nodeCount/elementCount/meshSizeMm, quality (minSICN, meanSICN, lowQualityCount), maxStressErrorPercent, trust { meshTrusted, reasons }, hotSpots [{ region, maxVonMisesMPa, nodeId, at, safetyFactor }], appliedForceN / reactionForceN / equilibriumResidual, meshMs / solveMs."New value: +"Solved evidence: maxVonMisesMPa, maxVonMisesAt, maxDisplacementMm, maxDisplacementAt, minSafetyFactor (+ minSafetyFactorRequired), nodeCount/elementCount/meshSizeMm, quality (minSICN, meanSICN, lowQualityCount), maxStressErrorPercent (high-stress region), trust { meshTrusted, reasons }, hotSpots [{ region, maxVonMisesMPa, nodeId, at, safetyFactor }]; the stress values, safety factor and hot spots exclude the support zone next to fixed-face edges (governingField), whose clamp-singular raw peak is reported as peakAtSupportMPa / peakAtSupportAt / peakAtSupportRegion with supportAdjacentNodeCount and supportZoneRadiusMm; appliedForceN / reactionForceN / equilibriumResidual, meshMs / solveMs."
  5. Changed1 schema field changed
    • changedInput schema / properties / file / description
      Previous value: -"Path to a .kcad.ts script declaring at least one feaStudy."New value: +"Path to a .kcad.ts script declaring at least one feaStudy. Hosted server: cannot read files from your machine — pass `code`, or `project:<slug>` for a saved project."
  6. Added

TDQS

Score is being calculated.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.