Skip to main content
Glama

FEM Mesh

fem_mesh

Create a Gmsh mesh for a FreeCAD body and attach it to an analysis, with control over element length and first- or second-order elements.

Instructions

Create a Gmsh mesh of body, attached to analysis.

char_length: max characteristic element length in mm. 0 = let Gmsh pick. min_length: min element length in mm. Default char_length/10, which keeps sliver edges in imported CAD from exploding the mesh; 0 removes the floor. element_order: '1st' or '2nd' (quadratic). Use '2nd' for bending/modal accuracy — linear tets (C3D4) shear-lock and overstiffen thin sections (a cantilever's first natural frequency lands ~50% high with only 1-2 elements through the thickness; 2nd-order tets bring it within ~1% of beam theory). Default lets Gmsh choose. Returns {handle, name, nodes, tets, min_length}.

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": {
      "analysis": "<analysis>",
      "body": "<body>"
    },
    "name": "fem_mesh"
  }
}

Input Schema

NameRequiredDescriptionDefault
bodyYes
nameNoMesh
analysisYes
workspaceNoRun this call in this named workspace
min_lengthNo
char_lengthNo
element_orderNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.5.7
    • addedInput schema / properties / min_length
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "number"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Min Length"
      +}
    • addedInput schema / properties / workspace
      Added value: +{
      +  "default": "",
      +  "description": "Run this call in this named workspace",
      +  "title": "Workspace",
      +  "type": "string"
      +}
  2. First observed

TDQS

A3.6/5.0
Behavior3/5

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

Annotations already declare a non-read-only, non-destructive, closed-world creation call, so the safety profile is covered. The description adds the return shape and the reasoning behind the min_length floor, which is genuine extra context. It does not say whether re-meshing an already-meshed body replaces or duplicates the existing mesh, nor whether the call is expensive/blocking.

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?

Purpose is front-loaded in sentence one, then each parameter gets a compact block with no filler. The cantilever example is longer than strictly needed but earns its place by justifying the '2nd' recommendation.

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?

For a 7-parameter, no-output-schema tool the description supplies the return value (handle, name, nodes, tets, min_length), which is valuable. It omits prerequisites (body must exist, analysis presumably created via `fem_new_analysis`), and says nothing about mesh sizing defaults or cost, leaving meaningful gaps for a meshing operation.

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 only 14%, so the description has to carry the load and largely does: char_length, min_length and element_order get units (mm), default behavior, and edge cases (0 = let Gmsh pick, 0 removes the floor). The remaining parameters (`body`, `analysis`, `name`, `workspace`) are left to the first sentence or the schema, which is mostly adequate but not complete.

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 and resource ("Create a Gmsh mesh of `body`, attached to `analysis`"), which is far more informative than the title alone. It does not, however, distinguish itself from the nearby `fem_mesh_refinement` or place itself in the analysis workflow, so an agent must infer the boundary.

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 description gives real guidance for one parameter choice ('2nd' for bending/modal accuracy, with a shear-locking rationale), which is choice guidance rather than tool-selection guidance. There is no explicit statement of when to use this versus `fem_mesh_refinement`, nor required preconditions like an existing analysis object.

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