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

Set a workspace variable

cm_set_workspace_var
Destructive

Set a variable or field. The old value is logged and cm_revert_all restores it. Model-workspace changes live in memory until cm_model_save. Requires an idle simulation.

Instructions

Set a variable or field. The old value is logged and cm_revert_all restores it. Model-workspace changes live in memory until cm_model_save. Requires an idle simulation. overruled_by in the answer: the model has a variable of that name in its own workspace and uses that one, so set it there.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesVariable or field, e.g. 'Kp_12' or 'Table.Value'
scopeNo'base' for the MATLAB base workspace, or the name of a loaded Simulink model for that model's workspacebase
valueYesNumber, string, list or nested list (matrix)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.9/5.0
Behavior5/5

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

Goes well beyond the destructiveHint annotation: the old value is logged and recoverable via cm_revert_all, model-workspace edits are in-memory until cm_model_save, an idle simulation is required, and the overruled_by answer reveals a name-shadowing behavior. This is unusually rich disclosure for a mutating tool.

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?

Purpose leads, followed by persistence, prerequisite, and the overruled_by caveat — all earning their place. The final 'overruled_by' sentence is slightly tangled but conveys a non-obvious behavior, so the cost is minor.

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 the return format need not be explained, and annotations cover the safety profile. The description adds persistence, revert, and prerequisite context, leaving only deeper detail on the overruled_by interaction unstated.

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 name, scope, and value are already documented in the schema; baseline 3 applies. The description's only added semantic is the shadowing/overruled case, which is more of a return-value nuance than parameter guidance.

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

Purpose4/5

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

States a specific verb (Set) and resource (a variable or field), and the scope parameter description distinguishes base vs model workspace. It differentiates somewhat from cm_get_workspace_var and cm_model_set via the workspace framing, though it never explicitly names those siblings.

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?

Provides a real prerequisite ('Requires an idle simulation') and points to related tools (cm_revert_all, cm_model_save), which is more than nothing. But it never states when to prefer this over cm_model_set or how it relates to cm_create/cm_edit, so usage selection is left mostly implicit.

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