Skip to main content
Glama

Save Simulink's logged data to a MAT file

cm_model_logs_save

Write Simulink logged signals and To Workspace blocks from a CarMaker run to a MAT file, including base and model workspace variables.

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). Requires an idle simulation. The result file (.erg) holds CarMaker's quantities; this holds the Simulink side.

Input Schema

TableJSON 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

TableJSON 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 already declare it is a non-read-only, non-destructive, closed-world write. The description adds genuine behavioral context beyond that: the idle-simulation prerequisite and the exact file contents (variables: signals, base_workspace, model_workspace, info). It does not address overwrite semantics beyond the schema param, but the added context is substantive.

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?

Three sentences, front-loaded with the core action, then prerequisites, then sibling differentiation. The parenthetical variable list is dense but earns its place by describing file output; overall efficient with little waste.

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, annotations covering the safety profile, and 100% schema description coverage across 8 params, the description supplies the remaining needed context: idle-simulation requirement and file-content semantics. Complete enough to invoke correctly.

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 description coverage is 100%, so every parameter's enum/default semantics are already documented in the schema. The description restates workspace content grouping but adds no syntax or format detail beyond the schema, so the baseline 3 applies.

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+resource ('write what Simulink logged ... to a MAT file') and clarifies scope against the sibling save tools by contrasting with the .erg result file ('The result file (.erg) holds CarMaker's quantities; this holds the Simulink side'). An agent can distinguish this from cm_model_save and cm_dva_write without opening schemas.

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 clear triggering context ('After a CarMaker for Simulink run') and a prerequisite ('Requires an idle simulation'). It does not name an explicit alternative tool to use instead when the simulation is not idle, so it stops short of full when/when-not routing.

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