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

Restore Layer State

layer_state_restore

Apply a saved layer state to existing drawing layers, skipping missing ones and leaving new layers untouched. Reports how many layers and properties moved, with warnings for refusals.

Instructions

Apply a saved state to the layers that still exist.

missing_layers (in the state, not in the drawing) are skipped, never created; new_layers (in the drawing, not in the state) are untouched; applied says how many layers and which properties moved. Refusals: an unknown state name (lists the saved ones), a property outside the eight (names the index). Live, a layer AutoCAD refuses to change (freezing the active layer, making a frozen layer current) lands in warnings instead of failing the call; the state's current layer is thawed before it is made current when frozen is being restored, so save → freeze → restore round-trips. Portable server states, not Layer States Manager entries. Pack: settings · lean: no.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesA name from layer_state_list
propertiesNoSubset of on, frozen, locked, color, linetype, lineweight, plot, current; omit for all

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.6.0

TDQS

A4.4/5.0
Behavior5/5

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

Annotations only declare readOnlyHint=false and destructiveHint=false; the description goes far beyond that, disclosing skip/untouched semantics, refusal reasons (unknown name, out-of-range property index), the live-warning path for layers AutoCAD won't change, and the thaw-before-current round-trip behavior. That is exactly the mutation behavior an agent needs before invoking.

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 and packs substantial detail into few sentences with no filler prose. The trailing "Pack: settings · lean: no." is terse metadata of unclear value and slightly detracts from an otherwise tight description.

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?

Even though an output schema exists (applied/warnings/missing_layers/new_layers), the description covers the edge cases an agent must anticipate: skipped layers, untouched layers, refusals, and warning-vs-failure semantics. Nothing needed to call this correctly is missing.

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% and the schema already enumerates the eight properties and the `name` source, so the description is largely restating structured data. It adds only marginal nuance (property index naming on refusal, the current-layer thaw interaction with the `frozen` property).

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 ("Apply a saved state to the layers that still exist") and immediately scopes behavior: missing layers skipped/never created, new layers untouched. This distinguishes it cleanly from layer_state_save/delete/list and from the Layer States Manager.

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?

Clarifies the domain boundary ("Portable server states, not Layer States Manager entries") and points at layer_state_list as the source of valid names. However, it never explicitly routes the agent to layer_state_save, layer_state_delete, or view_named_restore, so the when-not/alternative guidance is implied rather than stated.

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