Skip to main content
Glama
U-C4N
by U-C4N

Save Layer State

layer_state_save

Save a named snapshot of all layer on/frozen/locked/color/linetype/lineweight/plot flags plus the current layer to the drawing, so setups can be restored and travel with the file.

Instructions

Snapshot every layer's on/frozen/locked/color/linetype/lineweight/plot flags plus the current layer as a named state stored in the drawing.

These are the server's own portable layer states: JSON chunks in an XRECORD under the ACADMCP_LAYERSTATES dictionary. They live in the file and travel with it, work on both engines, and do not appear in AutoCAD's Layer States Manager (LAYERSTATE). Same name replaces (replaced: true). Refusals: an empty or control-character name, a non-string description. Pack: settings · lean: no.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesState name, e.g. PLOT-SET or DESIGN
descriptionNoFree text stored with the state

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.6.0

TDQS

A4.6/5.0
Behavior5/5

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

Annotations only give readOnlyHint=false and destructiveHint=false; the description goes well beyond that, disclosing the XRECORD/ACADMCP_LAYERSTATES storage location, file portability, cross-engine behavior, non-visibility in LAYERSTATE, overwrite semantics, and the specific refusal conditions. That is exactly the mutation-context an agent needs.

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 core action in one sentence, then layers storage, replacement and refusal facts compactly. The trailing 'Pack: settings · lean: no.' is server-internal jargon that consumes space without informing tool selection.

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?

With an output schema present, return values need not be explained, and the description still covers storage format, overwrite behavior and failure modes. Nothing material for correct invocation is missing.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3, but the description adds genuine constraint semantics beyond the schema: the name must be non-empty and free of control characters, and the description must be a string. Those are validation rules the schema does not encode.

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 precise verb+resource and enumerates exactly what is captured (on/frozen/locked/color/linetype/lineweight/plot flags plus current layer) into a named state. It is trivially distinguishable from siblings layer_state_list, layer_state_restore and layer_state_delete.

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?

Explains the storage model and the key operational rule (same name replaces, returning replaced: true), and implicitly separates itself from AutoCAD's own Layer States Manager. It never explicitly says when to prefer this over layer_state_restore or layer_state_list, so routing is clear but not spelled out.

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