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

Batch: Run Tools

cad_batch
Destructive

Reduce round trips by executing multiple AutoCAD operations in a single batch, chaining results from earlier steps into later ones.

Instructions

Execute an ordered list of tool calls in ONE round trip.

N calls collapse into one request/response pair, and bind lets a later step reference an earlier step's result so handles never have to be echoed back through the model.

steps=[
  {"tool": "entity_create_line",  "args": {...}, "bind": "edge"},
  {"tool": "point_from_snap",     "args": {"handle": "$edge", "snap": "mid"},
                                  "bind": "mid"},
  {"tool": "entity_create_circle","args": {"cx": "$mid.x", "cy": "$mid.y",
                                           "radius": 4}},
]

Successful steps report only their handle; pass verbose=True for the full result. Anything without a handle is returned whole.

VALIDATION runs first, always: an unknown tool, a schema-invalid argument or a reference no earlier step binds refuses the whole batch before anything executes. on_error governs run-time failures only. dry_run=True returns that validation report and executes nothing.

ERRORS are typed, never text: each failed step carries error.kind - one of unsupported (with the backend capability), invalid_args, refused, failed, unknown_tool, unresolved_ref, denied, malformed_step.

ATOMICITY is reported, not assumed. Read the atomicity block: on the headless backend rollback restores a full document snapshot; on live AutoCAD it sends an UNDO whose landing AutoCAD never confirms. The default on_error="stop" claims nothing and is exact on both.

NOT CALLABLE from a batch: the raw command/LISP escape hatches, and cad_batch itself. Call those directly.

For a few hundred entities of the same kind, entity_batch_create is denser still (no per-step tool name) - and it can be one step of a cad_batch.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
stepsYesOrdered steps. Each: {'tool': <tool name>, 'args': {...}, 'bind': <optional name>}. 'bind' names this step's result so a later step can reference it as '$name' (its handle), '$name.field' or '$name.list.0'. '$$' is a literal dollar sign.
dry_runNoValidate every step against its tool's real JSON Schema and execute nothing.
verboseNoReturn each step's full result instead of just its handle.
on_errorNostop (default): halt at the first failure, keep what already ran. continue: run every step. rollback: open a checkpoint first and undo on failure - read the returned `atomicity` block for what that is worth on this backend.stop

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior5/5

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

The description adds extensive behavioral detail beyond annotations: validation runs first, error types are typed, atomicity is reported but not assumed, and rollback behavior differs between backends. This goes far beyond the destructiveHint annotation and provides critical context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Although lengthy, every section earns its place: code example, validation semantics, error types, atomicity, exclusions, and alternative tools. The structure uses bold headers and a clear logical flow, making complex information digestible.

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 description covers all critical aspects of a complex orchestration tool: validation, error taxonomy, atomicity, dry_run, verbose, nesting limitations, and alternatives. With an output schema present, not detailing return format is acceptable. No gaps identified.

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

Parameters5/5

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

Schema coverage is 100%, but the description enriches parameters with a concrete example, explains 'bind' referencing syntax ($name, $name.field, $name.list.0), and clarifies '$$' as a literal dollar sign. It also explains the semantics of on_error options like rollback and its caveats.

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 description opens with 'Execute an ordered list of tool calls in ONE round trip,' which is a specific verb+resource statement clearly distinguishing it from other tools. It also names sibling tool entity_batch_create as an alternative, providing clear differentiation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly states when to use cad_batch vs alternatives: 'For a few hundred entities of the same kind, entity_batch_create is denser still.' It also lists exclusions: 'NOT CALLABLE from a batch: the raw command/LISP escape hatches, and cad_batch itself. Call those directly.' This is exemplary usage guidance.

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/U-C4N/Autocad-MCP'

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