Skip to main content
Glama
COMSOL Multiphysics MCP Server

COMSOL Multiphysics MCP Server

by zixuanguo89

anim_export

Export a COMSOL plot group as a movie or numbered PNG image sequence with configurable format, frame rate, and resolution, then validate frame counts and report output paths.

Instructions

Export a COMSOL-native animation of a plot group (movie or image sequence).

Creates result().export().create(tag, "Animation"), applies the COMSOL 6.4 Animation properties, runs it, and validates the output (GIF frame count with Pillow, video frame count with imageio).

Args: plotgroup: plot group tag to animate, e.g. "pg1" (see anim_list / plot_list). format: movie container: "gif" (no external deps, default), "avi" or "webm". output: output path. Movie: e.g. "C:/out/heat.gif". For kind="imageseq" pass the frame base path, e.g. "C:/out/frame" -> frame1.png, frame2.png, ... Omit to auto-generate under the artifact workspace. kind: "movie" (default) or "imageseq" (numbered PNG frames). fps: frames per second for movies (positive int, default 10). maxframes: number of frames (>= 2, default 25). Fewer stored solutions produce fewer frames; COMSOL samples the available range evenly. width: frame width in px (default 640, used when size="manual"). height: frame height in px (default 480). size: "manual" (default) | "current" | "hd". sweeptype: "solutions" (default) | "parameter" | "globalparameter" | "dde" | "streamline". solnumtype: parametric sweep selection: "all" (default) | "level1" | "level2" | "level3" | "inner" | "outer". solnum: explicit 1-based solution numbers to animate, e.g. [1,3,5]. looplevel: explicit loop-level solution indices, e.g. [1,2,3,4]. framesel: "all" | "number" (COMSOL default "number" = use maxframes). background: "current" | "color" | "fromtheme" | "transparent". reverse: true = play the animation backwards (time reversal). image_options: "on"/"off" — enable optional image components (title/legend/axes/logo). show_legend: plot legend on/off when image_options="on". show_title: plot title on/off when image_options="on". extra_properties: raw COMSOL Animation export properties to override, e.g. {"repeat": "forever", "resolution": "150"}. tag: explicit export feature tag (auto "anim1", "anim2", ...). model: model name/tag (None = current model).

Returns: JSON with path, size, format, frame count, dimensions, fps, duration and valid flag; for image sequences also frame_paths.

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": {
      "plotgroup": "<plotgroup>"
    },
    "name": "anim_export"
  }
}

Input Schema

NameRequiredDescriptionDefault
fpsNo
tagNo
kindNomovie
sizeNomanual
modelNo
widthNo
formatNogif
heightNo
outputNo
solnumNo
reverseNo
frameselNo
looplevelNo
maxframesNo
plotgroupYes
sweeptypeNo
backgroundNo
show_titleNo
solnumtypeNo
show_legendNo
image_optionsNo
extra_propertiesNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.1/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 underlying COMSOL calls (result().export().create(tag, "Animation")), that it runs the export and then validates output using Pillow and imageio, and that a persistent export feature tag is created (anim1, anim2, ...). It leaves unstated whether an existing file at 'output' is overwritten and how long an export typically takes, so it is strong but not exhaustive for a mutating, potentially slow operation.

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?

Purpose is front-loaded in the first sentence and the rest is a structured Args/Returns block, which is the right shape for a 22-parameter tool. It is long but nearly every line carries a default, constraint, or example; only the internal COMSOL implementation detail line is arguably padding for an agent selecting the tool.

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?

For a 22-parameter tool with no output schema and no annotations, the description covers what an agent needs: how to get a valid plotgroup, mode selection, sizing, frame selection, and an explicit Returns section describing path, size, format, frame count, dimensions, fps, duration, valid flag, and frame_paths for image sequences.

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 description coverage is 0% and there are 22 parameters, so the description must compensate entirely — and it does. Nearly every parameter gets its accepted values, default, and a concrete example (e.g. output "C:/out/frame" producing frame1.png, frame2.png; maxframes >= 2 with the note that COMSOL samples available solutions evenly; solnum as 1-based indices like [1,3,5]; extra_properties as raw COMSOL overrides).

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 gives a specific verb and resource: export a COMSOL-native animation of a plot group, with the two output modes (movie or image sequence) named up front. It also points to anim_list / plot_list for discovering the plotgroup tag. It stops short of distinguishing this tool from close siblings such as anim_export_frames, anim_quick, or plot_export_image, so an agent still has to guess which animation path to take.

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?

Usage guidance is internal rather than comparative: it explains when to pick kind="movie" vs "imageseq", that gif needs no external deps, and that omitting output auto-generates under the artifact workspace. There is no explicit statement of when this tool should be preferred over the many adjacent animation/plot-export tools in the sibling set.

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