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

Define Block

block_define

Create validated AutoCAD block definition with geometry and attribute definitions, preventing malformed specs from writing partial data. Optionally overwrite existing blocks or create missing layers.

Instructions

Create a block definition with attribute definitions from typed specs.

The whole request is validated before anything is written: one malformed entry refuses the call and leaves no definition behind. Refusals: a malformed primitive or ATTDEF (names entities[i]/attdefs[i] and the key), a non-finite base point (names base_x/base_y), a name clash without overwrite, an anonymous * name, and a primitive layer that is not in the drawing's layer table (names the missing layers) unless create_layers=true, which creates them and lists them in layers_created. overwrite=true replaces the contents of an existing block so its INSERTs keep pointing at the name and show the new geometry; replaced reports it. Geometry inside the block is ByBlock so the INSERT's layer supplies colour and lineweight. Insert with block_insert(attributes={TAG: value}).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesNew block definition name
base_xNoBlock base point X
base_yNoBlock base point Y
attdefsNoAttribute definitions: {tag, x, y, height, prompt?, default?, rotation_deg?, align?, invisible?}
entitiesYesPrimitives in block-local coordinates. type=line {x1,y1,x2,y2} | circle {cx,cy,r} | arc {cx,cy,r,start_deg,end_deg} | polyline {points,closed,bulges?} | text {text,x,y,height,rotation_deg?,align?} | solid {points (3-4)}. Optional layer (default 0).
overwriteNoReplace the contents of an existing definition of this name
create_layersNoCreate primitive layers that do not exist yet (default: refuse and name them)

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 supply readOnlyHint=false. The description carries the full behavioral load: all-or-nothing validation before any write, the exact refusal cases (malformed primitive/ATTDEF, non-finite base point, name clash, anonymous '*' name, missing layers), overwrite replacing contents while preserving INSERT references, ByBlock geometry inheriting INSERT layer colour/lineweight, and the layers_created/replaced outputs. This is well beyond the annotation.

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?

Dense but front-loaded, with the atomicity guarantee first and refusal modes enumerated compactly. Every sentence carries information, though the run-on refusal list is slightly heavy to parse in one pass.

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?

For a mutating tool with 7 params, atomic-write semantics and an output schema, the description covers the transaction behavior, failure modes, overwrite semantics and the follow-up insert call. Nothing an agent needs to invoke it correctly 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 already 100%, so the baseline is 3, but the description adds real semantic value: overwrite replaces the *contents* so existing INSERTs keep pointing at the name, and create_layers creates then lists the layers in layers_created rather than refusing. It does not re-explain name/base_x/base_y beyond the schema.

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?

Opens with a specific verb+resource ('Create a block definition with attribute definitions from typed specs') and distinguishes itself from siblings like block_create_from_entities and block_insert, even naming the latter as the downstream consumer. An agent can identify the operation without opening the schema.

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?

Explicitly routes the agent: use overwrite=true to replace contents, create_layers=true to auto-create missing layers, and use block_insert to place the block afterwards. It enumerates refusal conditions clearly, though it does not contrast against block_create_from_entities, the closest alternative for making blocks from existing entities.

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