Skip to main content
Glama
COMSOL Multiphysics MCP Server

COMSOL Multiphysics MCP Server

by zixuanguo89

export_model_java

Exports a COMSOL model as a compilable .java source file that rebuilds the model without solution data. Use .mph export when a full model file is needed.

Instructions

Export the model as a COMSOL Java model file (.java source).

Verified live in COMSOL 6.4: model.java.save(path, "java") writes a compilable Java class that rebuilds the model (a few KB; does not contain the solution data). Use export_model_file for a full .mph.

Args: path: output .java path (auto under artifact root when omitted). model: model name/tag (None = current model).

Returns: {"path","size","exists","format":"java"}.

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_model_java"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathNo
modelNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.7/5.0
Behavior4/5

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

No annotations are supplied, so the description carries the full burden and discharges most of it: it says the output is a compilable Java class that rebuilds the model, that it is only a few KB, and critically that it does not contain solution data. It also pins the behavior to a verified COMSOL 6.4 call (model.java.save). It stops short of stating overwrite behavior for an existing path or any permission requirements, which is the remaining gap.

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-loaded with the one-line purpose, then supporting behavior, then a structured Args/Returns block — every sentence carries information. The reST double-backtick markup and the Args/Returns scaffolding are slightly heavier than needed for a two-parameter tool, but nothing is redundant.

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?

Even though no output schema exists, the description spells out the return object ({path, size, exists, format}) and quantifies the artifact size and its content gap versus .mph. For a two-parameter export tool with no annotations, that is a complete picture.

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%, so the description must compensate and it does: it explains that path is the output .java path and defaults to auto under the artifact root when omitted, and that model is a name/tag with None meaning the current model. Both of the two parameters gain meaning not present in the bare schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Export the model as a COMSOL Java model file (.java source)') and immediately distinguishes itself from the sibling export_model_file, which produces a full .mph. The agent can tell which exporter it needs without opening any schema.

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

Usage Guidelines5/5

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

Explicitly names the alternative and the condition that selects it: 'Use ``export_model_file`` for a full ``.mph``.' That gives a clear when-to-use-this and when-to-use-the-other split, which is exactly the routing guidance an agent needs between two near-identical exporters.

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