Skip to main content
Glama
carmaker-mcp
by dimitr-io

Save Simulink's logged data to a MAT file

cm_model_logs_save

Save Simulink logged signals and To Workspace data to a MAT file after a CarMaker for Simulink run, including base and model workspace variables; use it to verify which signals are logged.

Instructions

After a CarMaker for Simulink run: write what Simulink logged (signals marked for logging and To Workspace blocks) to a MAT file, with the base workspace and the model workspace as one struct each (variables: signals, base_workspace, model_workspace, info); the answer lists signal_names. Requires an idle simulation. The result file (.erg) holds CarMaker's quantities, this the Simulink side. To see whether a signal is logged, run with save_logs=true and read signal_names.

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

Input Schema

NameRequiredDescriptionDefault
fileNoMAT file to write, inside the project (default: next to the last result file, with the same name)
logsNoinspector: every signal the Simulation Data Inspector holds for the last run (logged signals and To Workspace blocks, complete). workspace: the logging variables in the base workspace as they areinspector
modelNoLoaded Simulink model (default: the active one)
formatNodataset: a Simulink.SimulationData.Dataset. struct: plain arrays (name, time, values, units, block) that load without Simulinkdataset
overwriteNoReplace the file if it exists
timeout_sNoLongest time MATLAB may take to write the file
base_workspaceNoInclude the base workspace's variables
model_workspaceNoInclude the model workspace's variables

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.1/5.0
Behavior4/5

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

Annotations only declare the generic write/safe-local profile; the description adds real context: it requires an idle simulation, writes inside the project, and defaults the filename next to the last result file. It does not say what happens when the simulation is running (error vs. queue) or how long a large dataset write may block beyond the timeout parameter.

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?

The action and scope are front-loaded in the first sentence, followed by prerequisites and the sibling distinction. Slightly dense with parentheticals, and the workspace-struct detail partly duplicates the base_workspace/model_workspace schema entries.

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?

With an output schema present and 100% schema coverage, the description only needs to cover intent, preconditions, and sibling boundaries, which it largely does. Failure modes (locked file, overwrite=false collision, running simulation) are left unstated but are minor given the annotations.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so every parameter including both enums is already documented in structured data; the description adds little parameter-level meaning beyond restating that the workspaces are written as structs. The 'save_logs' reference points at a different tool's parameter and is not applicable here, so baseline 3 is appropriate.

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 ('write what Simulink logged ... to a MAT file') and enumerates the contents (signals, base_workspace, model_workspace, info). It also explicitly separates itself from the CarMaker-side result tool: 'The result file (.erg) holds CarMaker's quantities, this the Simulink side.'

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?

Gives a clear timing context ('After a CarMaker for Simulink run') and a prerequisite ('Requires an idle simulation'). It even routes the agent for a related question ('To see whether a signal is logged, run with save_logs=true and read signal_names'), though it doesn't name a sibling tool or state when not to use this one.

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