Skip to main content
Glama

exec_model_api

Run custom COMSOL Java API code to directly control models and automate modeling, meshing, solving, and post-processing tasks.

Instructions

Run arbitrary COMSOL Java API code.

Provide either a full class with public static String run(Model model), or a Java snippet body; it will be wrapped automatically and executed in the COMSOL JVM (best-effort in live mode, always via compile+run in batch mode).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Install Server

TDQS

A4.3/5.0
Behavior4/5

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

With no annotations, the description carries the burden of behavioral disclosure. It does well: it states that snippets are automatically wrapped, execution happens in the COMSOL JVM, and live vs. batch mode behave differently. It does not mention side effects, error behavior, or environment restrictions, but it is reasonably transparent for an arbitrary-code execution tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is compact and well-structured: a one-sentence purpose, followed by the two accepted input forms and execution-mode caveat. Every sentence earns its place; there is no redundancy or filler.

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 an arbitrary-code tool, it covers the essential input formats, the expected method signature, and compile/run behavior. An output schema is present, so return-value documentation is structurally covered. It omits details about imports, available classes, timeouts, or failure modes, but is otherwise sufficient for advanced usage.

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?

The schema only defines 'code' with 0% description coverage, so the description must add meaning. It does substantially: it specifies the required method signature `public static String run(Model model)`, distinguishes full-class vs. snippet input, and explains automatic wrapping. This is essential semantics beyond 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?

The description opens with a specific verb and resource: 'Run arbitrary COMSOL Java API code.' It clearly distinguishes this tool from the sibling tools, which are high-level operations like add_sphere or run_solver, by positioning exec_model_api as the generic escape hatch for custom Java API calls.

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?

The description explains how to supply code (full class vs. snippet) and how it will be wrapped, but it does not explicitly state when to prefer this tool over the provided sibling tools. 'Arbitrary' implies it is for custom operations not covered by the other tools, but no explicit alternatives or exclusions are given.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Twofruitsgrape/comsol-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server