Skip to main content
Glama
COMSOL Multiphysics MCP Server

COMSOL Multiphysics MCP Server

by zixuanguo89

plot_export_image

Render and export COMSOL plot groups as image files with chosen format, dimensions, DPI, background, and antialiasing, validating the written output.

Instructions

Render plot group(s) and export image file(s), validated with Pillow.

Exports COMSOL's Image feature with the exact clientapi properties: plotgroup, imagetype, <type>filename (pngfilename / jpegfilename / bmpfilename / epsfilename / gltffilename), width/height (px when unit="px"), unit, resolution (dpi), optional size preset, background, antialias.

Args: plotgroup: single plot group tag to export (e.g. "pg1"). path: output file path. For a single plot group a .png/.jpg path is used as-is; when omitted a unique path under <artifact_root>/<model>/<timestamp>_plots/ is generated. For multiple plot groups this is treated as a directory. width: image width in px (default 1200). height: image height in px (default 900). unit: px (default) | mm | in. dpi: optional COMSOL resolution property (e.g. 150). imagetype: png (default) | jpeg | bmp | eps | gltf. eps only works for 1D plot groups; gltf is 3D-only and may not be produced in headless COMSOL 6.4. size: optional COMSOL size preset manualprint/manualweb/ current/presentation; leave empty to honour width/height. background: current | color | transparent. antialias: on | off. plotgroups: export several plot groups in one call (list of tags); alternatively omit both plotgroup and plotgroups to export every plot group in the model. model: model name/tag (None = current model).

Returns: For one group: {"path","size","width","height","format","valid", "plotgroup", ...} measured on the written file. For several: {"images": [ ... ], "count", "directory"}.

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

Input Schema

NameRequiredDescriptionDefault
dpiNo
pathNo
sizeNo
unitNopx
modelNo
widthNo
heightNo
antialiasNo
imagetypeNopng
plotgroupNo
backgroundNo
plotgroupsNo

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 supplied, the description carries the full burden and does well: it discloses default output dimensions, that a unique path is auto-generated under <artifact_root>/<model>/<timestamp>_plots/ when path is omitted, that output is verified on the written file, and that some formats may silently not be produced. It does not state whether existing files are overwritten or what permissions/environment the export requires, which is the remaining behavioral gap for a file-writing tool.

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?

It is long but front-loaded with the purpose and then structured as Args/Returns, so an agent can skim to the parameter it needs. Some content is duplicated, since the opening paragraph enumerates clientapi properties (width/height/unit/resolution/size/background/antialias) that the Args block explains again, costing a little density.

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 12-parameter, annotation-free file-producing tool with no output schema, the definition covers parameters, defaults, path resolution, format caveats, and even a Returns description of both single-image and multi-image response shapes. The only omissions are overwrite behavior and error/failure signaling.

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 all 12 parameters are documented in the Args block with meaning the schema lacks: enum values for unit (px/mm/in), imagetype (png/jpeg/bmp/eps/gltf), size presets, background, and antialias, plus the interaction between unit="px" and width/height and the None-means-current-model semantics of model. This fully compensates for the empty schema descriptions.

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 opening sentence gives a specific verb and resource: render plot group(s) and export image file(s), with the added detail that the output is validated with Pillow. It is unambiguous what the tool does, but it never names a sibling such as export_plot or plot_export_plot_data, so an agent cannot tell from the description alone which of the export tools to pick.

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?

There is real conditional guidance: omit both plotgroup and plotgroups to export every group, plotgroups takes a list, and path is treated as a directory in the multi-group case. It also states format constraints (eps only for 1D plot groups, gltf is 3D-only and may not work in headless COMSOL 6.4). What is missing is guidance on when to choose this over the sibling export tools.

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