Skip to main content
Glama
COMSOL Multiphysics MCP Server

COMSOL Multiphysics MCP Server

by zixuanguo89

export_mesh

Export a COMSOL mesh to STL, Nastran, 3MF, PLY, or native files; choose format and selection options, then verify the saved file exists.

Instructions

Export a mesh to a file (STL, Nastran, 3MF, PLY, COMSOL native).

Uses COMSOL's mesh export tool: sets type, optional stlformat and selection, then calls mesh.export(path). The file is validated on disk (existence and byte size).

Args: tag: mesh tag (default "mesh1"; see export_list for tags). type: stl/stlbin (default), stlascii, nastran, 3mf, plybin, plyascii, nativebin (.mphbin), nativeascii (.mphtxt), sectionwise. vtu is not supported by COMSOL 6.4 clientapi. path: output file path (auto under artifact root when omitted). component: component tag owning the mesh; when omitted the model-level mesh(tag) accessor is tried first, then each component. selection: optional entity numbers to export (e.g. domain numbers). Omit for the whole mesh. stl_format: optional "binary"/"text" STL flavour. model: model name/tag (None = current model).

Example: export_mesh("mesh1", type="stl", path="C:/out/mesh.stl")

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": "export_mesh"
  }
}

Input Schema

NameRequiredDescriptionDefault
tagNomesh1
pathNo
typeNostl
modelNo
componentNo
selectionNo
stl_formatNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.2/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 load and does well: it states that a file is written via mesh.export(path) and is validated on disk for existence and byte size, and it explains the component-resolution fallback. It omits overwrite behavior, failure handling, and whether permission/compilation prerequisites exist.

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?

The content is front-loaded with the outcome, then a short mechanism sentence, then a structured Args block and an example, so it is easy to scan. Some implementation narration ('sets type, optional stlformat and selection, then calls mesh.export(path)') is arguably surplus, and the stlformat/stl_format naming drifts between prose and schema.

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 seven-parameter, annotation-free mutation tool with no output schema, the definition covers format vocabulary, path behavior, selection semantics, and on-disk validation. It stops short of saying what the call returns or whether an existing file at path is overwritten, which matters for a file-writing tool.

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 coverage is 0%, so the description must compensate, and it documents all seven parameters with real meaning: tag default and where to find tags, the full type vocabulary (including the note that 'vtu' is unsupported on COMSOL 6.4), path auto-placement under the artifact root, component lookup order, and that selection takes domain numbers.

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?

The first line names a specific verb and resource (export a mesh) and enumerates the supported output formats, which tells an agent exactly what the tool produces. It does not, however, distinguish itself from the sibling 'mesh_export' or 'export_geometry', so an agent choosing between them gets no help.

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?

It gives concrete usage context: consult export_list for tags, omit selection to export the whole mesh, and the component accessor is tried at model level first then per component. It lacks explicit when-not-to-use guidance relative to the mesh_export/export_geometry siblings.

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