Skip to main content
Glama
COMSOL Multiphysics MCP Server

COMSOL Multiphysics MCP Server

by zixuanguo89

mat_add

Add a material from a COMSOL material library to a model component, assign it to domains, and create an editable copy or live library link with optional property overrides.

Instructions

Add (copy) a material from a COMSOL material library to a component.

Reproduces the GUI "Add Material from Library" workflow: creates a LibraryLink material, loads the library values with reload() and by default unlinks it into an ordinary editable material with real library expressions (including temperature-dependent functions).

Args: name: exact library material name, e.g. "Copper", "Silicon", "Water, liquid" (see mat_library_search / mat_library_list). A full path such as "comsol_basic_material_lib.copper" also works. library: library id or label to disambiguate ("Built-in", "Fluids", "Optical", ...). Recommended when a name exists in several libraries (e.g. "Air"). component: component tag (default "comp1"); pass "" or "global" to create a global material under model definitions. selection: domain numbers to assign the material to (3D: domains, 2D: domains). Omit to leave the material unassigned. named: named selection tag to assign instead of selection. all_domains: true = assign all domains. unlink: true (default) = editable copy; false = keep it as a live library link (read-only, updates with the library). label: custom display name (default: the library material name). tag: custom material tag (default auto mat1, mat2, ...). properties: optional property overrides applied to the Basic group, e.g. {"density": "8000[kg/m^3]"}. model: model name/tag (None = current model). Returns: {"tag", "label", "material_path", "library", "match_type", "alternatives", "properties" (key values), "selection"}.

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

Input Schema

NameRequiredDescriptionDefault
tagNo
nameYes
labelNo
modelNo
namedNo
unlinkNo
libraryNo
componentNocomp1
selectionNo
propertiesNo
all_domainsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.5/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 behavioral burden and does well: it explains that a LibraryLink material is created, reload()ed, and by default unlinked into an editable material with real library expressions, and that unlink=false yields a read-only live link. The Returns block discloses the response keys (including match_type and alternatives, hinting at fuzzy matching). It does not state behavior on unknown names or name collisions, leaving some failure semantics uncovered.

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-loads the purpose in one sentence, then uses an Args/Returns structure that maps cleanly onto the 11 parameters. It is long, but the length is justified by the parameter count; the GUI-workflow sentence is mildly redundant narrative but does explain the unlink default, so it earns its place.

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 an 11-parameter mutation tool with no annotations and no output schema, the definition covers the essentials: workflow, defaults, all parameter semantics, and an explicit Returns description. An agent has enough to call it correctly without further inference.

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% across 11 parameters, so the description must carry everything, and it does: every parameter is documented with meaning, default, and examples (e.g. name examples like "Water, liquid", the component "" / "global" escape hatch, the properties override example {"density": "8000[kg/m^3]"}, and the tag default pattern mat1, mat2). This is substantial meaning added beyond bare schema types.

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?

Names a specific verb and resource ("Add (copy) a material from a COMSOL material library to a component") and immediately clarifies that this is a library copy rather than a from-scratch creation, which distinguishes it from siblings like mat_create and mat_assign. The verb+resource+scope combination lets an agent route correctly without opening the schema.

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?

Points to mat_library_search / mat_library_list for discovering valid names and states when the optional library argument is recommended (when a name exists in several libraries, e.g. "Air"). It also explains omitting selection vs. using named vs. all_domains, but never explicitly frames when to prefer mat_create or mat_assign over this tool, so it stops short of full alternative routing.

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