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, 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.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeNoInline kernelCAD script source (mutually exclusive with file).
fileNoPath to a .kcad.ts script declaring at least one feaStudy.
studyNoName of the study to run; defaults to the last declared one.
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
okYesFalse when the study violated its declared minSafetyFactor, a selector did not resolve, or the solver toolchain is missing.
errorNo
imagesNoAbsolute PNG paths of the rendered stress heatmap.
legendNoHeatmap colour bands { color, fromMPa, toMPa } — the scale the PNGs are drawn on.
out_dirNoDirectory holding the summary JSON, solver deck and heatmap PNGs.
summaryNoSolved 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.
artifactsNoAbsolute paths of the BREP geometry handoff, .inp deck, .frd results and mesh JSON, for hand reproduction.
errorCodeNo
diagnosticsNofea.* diagnostics raised by the run.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.5/5.0
Behavior4/5

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

Annotations indicate readOnlyHint=false and destructiveHint=false, but the description goes beyond by disclosing that the tool requires an external solver toolchain (CalculiX and gmsh), and that it fails with a specific error code if missing, never silently passing. It also mentions it meshes with quadratic tetrahedra and returns heatmap PNGs. This adds significant behavioral context beyond the annotations, though it does not fully explain the full computational cost or potential side effects on disk.

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?

The description is well-structured: it starts with the primary use case, then explains the workflow, the dependencies and error handling, and finally lists parameters in a single sentence. It is dense but every sentence adds value, with no fluff. The key usage guidance is front-loaded.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of the tool (8 parameters, no required ones, output schema present), the description covers all essential aspects: the purpose, the setup, the failure mode, and the key parameters. The output schema already explains returns, so the description does not need to. It also notes the fast numbers-only run. It is sufficient for an agent to select and invoke correctly.

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

Parameters3/5

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

The schema description coverage is 100%, so the schema already documents each parameter. The description adds a concise summary of the key parameters: file/code, study, output_dir, mesh_size, heatmaps. It does not go into detailed semantics for each, but the baseline for high coverage is 3, and the description's overview is adequate.

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?

The description clearly states the tool's purpose: to run a linear-static structural FEA to determine if a part will hold a load. It specifies the verb 'run', the resource 'structural study', and details the workflow (mesh, solve, return evidence). It distinguishes from siblings like fea_summary (which likely summarizes results) by focusing on the execution of the analysis.

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

Usage Guidelines5/5

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

The description opens with 'Use this when you need to know whether a part will hold a load', which is clear guidance on when to use this tool. It also mentions the script declaration and the optional study parameter, and implicitly contrasts with fea_summary. It does not explicitly name alternatives, but the context signals (siblings) and the first sentence provide direction for an agent.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.