Skip to main content
Glama
COMSOL Multiphysics MCP Server

COMSOL Multiphysics MCP Server

by zixuanguo89

mesh_set_size

Set explicit mesh size properties such as maximum/minimum element size and growth rate, applying them globally or to selected entities and enabling user-controlled meshing.

Instructions

Set explicit mesh size properties (hmax, hmin, growth rate, ...).

When user_controlled=True (default) the sequence is switched to a user-controlled mesh (automatic(false)), which is required for manual sizes to take effect. Without selection the global size feature is edited; with a selection a localized Size feature is created.

Args: hmax: maximum element size, e.g. "0.05" (model length unit) or "5[mm]". hmin: minimum element size. hgrad: maximum element growth rate (e.g. "1.5"). hcurve: curvature factor (e.g. "0.6"). hnarrow: resolution of narrow regions (e.g. "0.5"). hauto: predefined size level 1..9 (sets automatic sizing). mesh: mesh sequence tag (None = first). feature: existing size feature tag to edit (None = global "size"). selection: domain/boundary numbers for a localized size feature. named: named selection tag for the size feature. all_entities: apply the localized size to all entities. entity_dim: selection dimension for the localized size (default geom dim). user_controlled: switch the sequence to a user-controlled mesh (default true). component: component tag (None = auto-detect). model: model name/tag (None = current model). Example: mesh_set_size(hmax="0.02", hmin="0.002", hgrad="1.3")

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "mesh_set_size"
  }
}

Input Schema

NameRequiredDescriptionDefault
hmaxNo
hminNo
meshNo
hautoNo
hgradNo
modelNo
namedNo
hcurveNo
featureNo
hnarrowNo
componentNo
selectionNo
entity_dimNo
all_entitiesNo
user_controlledNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4/5.0
Behavior4/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 well: it discloses the significant state mutation that the sequence is switched to a user-controlled mesh (automatic(false)), and the create-vs-edit branching based on whether selection is supplied. It omits return values, error behavior, and whether the switch is reversible.

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-loads the purpose sentence, then the behavioral caveat about user_controlled, then the Args list, then a concrete example. The length is justified by 15 undocumented parameters, and there is little wasted prose.

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?

For a 15-parameter, zero-annotation, no-output-schema tool, the definition covers parameter meaning, mode switching, and gives a worked example. Missing only return/result information and error conditions, which is acceptable given there is no output schema.

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 description coverage is 0%, so the description must compensate, and the Args block documents all 15 parameters including units and examples for hmax/hmin/hgrad/hcurve/hnarrow. Some entries are thin, e.g. entity_dim "selection dimension (default geom dim)" and selection "domain/boundary numbers", but overall it adds substantial meaning beyond the bare schema.

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: "Set explicit mesh size properties (hmax, hmin, growth rate, ...)". This clearly distinguishes it from mesh_auto_size by emphasizing explicit manual sizing, and the Args section enumerates exactly what can be set. It falls short of a 5 only because it never names the sibling tool it competes with.

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

Usage Guidelines4/5

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

Gives concrete usage context: "Without selection the global size feature is edited; with a selection a localized Size feature is created", and explains that user_controlled=True is required for manual sizes to take effect. It does not, however, say when to prefer mesh_auto_size or when not to use explicit sizing, and hauto (which "sets automatic sizing") creates an undocumented overlap with the auto-size sibling.

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