Skip to main content
Glama

autocad-site-mcp

cad_execute_script

Executes JavaScript to generate large or procedural geometry (loops, patterns, algorithms) without spending context tokens. Runs in a separate Node process that cannot write files, start programs or read anything outside the CAD sources; 30 s limit. Variables: CAD, M (CADMath), G (CADGeometry), E (CADEntities), S (CADState), D (CADDXF), L (CADLayouts), parametric, solid(recipe) (adds a 3D solid), console. Changes to the drawing are kept.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
scriptYesJavaScript code to execute. Can call S.addEntity(), parametric.*, M.*, E.*, etc.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.4/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does well: it discloses the sandbox ('separate Node process that cannot write files, start programs or read anything outside the CAD sources'), a 30 s execution limit, and that 'changes to the drawing are kept' (mutation persistence). It omits error behavior and what execution returns, which keeps it from a 5.

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?

Front-loads the purpose, then constraints, then the available API surface, then the persistence note. Every sentence carries information; the variable list is dense but directly actionable and nothing is filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

No output schema exists, so ideally the description would say what a successful run returns; it only states that drawing changes persist. Otherwise it is well matched to a single-parameter sandbox executor: constraints, timeout, and API surface are all covered.

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?

Only one parameter with 100% schema coverage, so the schema baseline is 3. The description goes beyond it by enumerating the injected globals (CAD, M, G, E, S, D, L, parametric, solid(recipe), console), which is genuinely useful for writing the script.

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 ('Executes JavaScript to generate ... geometry') and scopes it to 'large or procedural geometry (loops, patterns, algorithms)', which cleanly separates it from siblings like cad_generate_parametric and cad_batch_add_entities. An agent can tell what this tool is for 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?

Gives clear context for when it applies (procedural/looped/algorithmic geometry) and adds a value rationale ('without spending context tokens'). However, it never explicitly says when to prefer cad_generate_parametric or cad_run_commands over this, so no exclusions or routing are provided.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources