Skip to main content
Glama
CaeliaEve

AutoCAD MCP Ultra

by CaeliaEve

Get Viewport Selection

selection_get
Read-only

Retrieve entities pre-selected in the AutoCAD viewport (pickfirst) to scope operations to exactly those objects. Returns handles and entity details for downstream automation.

Instructions

Read the entities the user pre-selected in the AutoCAD viewport (COM backend only).

Returns the implied "pickfirst" selection — the entities highlighted with grips before invoking the AI — so work can be scoped to exactly those entities instead of the whole drawing. Typical use::

sel = selection_get()
dimension_auto(sel["handles"], style="chain")

Result keys: ok — True on the COM backend (even for an empty selection) count — number of selected entities handles — list of entity handles (hex strings) to act on entities — full per-entity info (type, layer, color, ...) pickfirst — state of the PICKFIRST sysvar (None if unknown) message — guidance when nothing is selected

On the ezdxf headless backend there is no viewport, so this returns ok=False with an empty handles list.

fields / compact shape the "entities" collection — this tool already returns an object, so the columnar envelope lands under that key rather than replacing the result. handles is unaffected, so a caller that only wants handles can pass fields=["handle"] and still read handles directly.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fieldsNoProject to these fields, in this order (e.g. ['handle','type','layer']); 'properties.<key>' reaches one nested value. Omit for the full record; an unknown name errors and lists the valid ones.
compactNoReturn a columnar {fields, rows, count, offset, total, truncated, next_offset} envelope instead of dicts: much cheaper per row, and the only shape that reports truncation.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior5/5

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

Beyond the readOnlyHint annotation, the description discloses detailed behavioral traits: result keys, empty-selection behavior (ok=True with guidance message on COM), backend fallback behavior (ok=False on ezdxf), and the nested columnar-envelope behavior for fields/compact. This is far richer than the annotation alone.

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 description is organized with a purpose statement, a compact code example, a bulleted result-key list, and a final note on parameter interaction. It is longer than minimal, but each section adds distinct value and nothing feels redundant.

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?

The tool has an output schema and read-only annotation, and the description still covers backend availability, empty-selection behavior, result keys, and parameter effects. A caller has all necessary information to invoke the tool and correctly interpret its results across both backends.

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 meaningful interaction semantics: the columnar envelope lands under the entities key rather than replacing the result, and handles remains readable even when fields=['handle'] is passed. This clarifies parameter effects beyond their standalone schema descriptions.

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?

The opening sentence names a specific verb ('Read') and resource ('entities the user pre-selected in the AutoCAD viewport'), and the COM-backend qualifier makes the scope precise. The 'pickfirst' explanation differentiates it from sibling selection tools like selection_polygon, selection_window, and selection_filter.

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?

The description clearly states the use case — scoping work to the user's pre-selected entities instead of the whole drawing — and provides a typical code example. It also warns about the ezdxf headless backend returning ok=False. It doesn't explicitly name alternative selection tools, but the context makes when to choose this tool clear.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/CaeliaEve/autocad-mcp-ultra'

If you have feedback or need assistance with the MCP directory API, please join our Discord server