| manage_sessionA | Manage CAD application lifecycle, COM connection, viewport controls, and undo/redo history. Behavior: Mutation: Controls external CAD application process, active COM session, and editor state. Persistence: Connection state persists across subsequent tool calls in the MCP server process. Side Effects: Can launch CAD application process (connect), terminate session (disconnect), or launch local web dashboard in browser (open_dashboard).
Usage Guidelines: When to Use: Call to verify CAD connectivity, connect to running CAD, inspect CAD vendor info, or perform composite session operations (e.g. connect + zoom_extents + status). Sibling Routing / Alternatives: For pure camera, zoom, 3D viewpoints, and visual styles, prefer manage_view. For opening, saving, closing, or switching drawing files, use manage_files. For creating geometry, use draw_entities.
Actions & Parameters: connect: Launches and connects to auto-detected CAD software (AutoCAD, ZWCAD, GstarCAD, BricsCAD). disconnect: Unlinks from active CAD COM session. status: Returns current connection status, active adapter type, and drawing name. list_supported: Lists installed and supported CAD application vendors. check_running: Detects running CAD processes without attaching. zoom_extents: Zooms active viewport to fit drawing extents. screenshot: Captures active CAD window raster screenshot as base64 PNG. export_view: Generates internal drawing raster preview. undo: Steps back in drawing history. Parameter: count (int, default: 1). redo: Steps forward in drawing history. Parameter: count (int, default: 1). open_dashboard: Launches web dashboard in browser. Parameters: host, port.
Parameters: Returns:
JSON string with per-operation status, connection details, and results. |
| manage_viewA | Control CAD camera viewport, display zoom, 3D viewpoint presets, and visual shading styles. Behavior: Mutation: Modifies interactive viewport display state (zoom factor, center point, view direction, visual style) in the active CAD editor window. Does NOT modify drawing database entities. Persistence: Viewport changes persist in the active drawing session until manually adjusted or closed. Side Effects: Refreshes display graphics in active CAD GUI. In screenshot/preview operations, reads screen framebuffer and returns base64 image data.
Usage Guidelines: When to Use: Call whenever navigating the drawing, zooming to extents (ze), zooming into specific coordinates (zw), switching to 3D axonometric perspectives (preset|iso_sw), changing shading (style|realistic), or stepping through history (undo/redo). Sibling Routing / Alternatives: For creating, configuring, or activating paperspace sheet presentations and architectural viewports, use manage_layouts. For launching an interactive web-based canvas viewer for human inspection in the browser, use show_drawing_viewer. For exporting vector PDF sheets or SVG files to disk, use export_data.
Shorthand Grammar (one command per line or semicolon-separated): ze (or zoom_extents): Zoom to fit all drawing entities in viewport. zw|x1,y1|x2,y2 (or zoom_window): Zoom into rectangular window bounds. zc|x,y|mag (or zoom_center): Center view on coordinate (x,y) with optional magnification factor. preset|top|bottom|front|back|left|right|iso_sw|iso_se|iso_ne|iso_nw: Switch 3D or orthographic viewpoint. style|2d|wireframe|conceptual|realistic|shaded|hidden: Set visual rendering mode. screenshot / preview: Capture visual raster snapshot of current drawing viewport. undo|count / redo|count: Step backward or forward in CAD session history (default count: 1).
Parameters: Returns:
JSON string containing per-operation execution results, success status, and details. |
| draw_entitiesA | Create new 2D/3D geometric primitives, text, dimensions, leaders, and native tables. Behavior: Mutation: Mutates the drawing database by creating and appending new entities. Persistence: Changes persist in the active drawing database and are written to DWG/DXF file upon save. Side Effects: Auto-creates destination layers if they do not exist. Automatically computes centroid and extents.
Usage Guidelines: When to Use: Call whenever creating new geometry from scratch (lines, walls, circles, rectangles, polylines, text labels, architectural dimensions, multi-arrow leaders, or schedule tables). Sibling Routing / Alternatives: For modifying, transforming (move, rotate, scale), restyling, or deleting existing entities, use manage_entities. For inserting reusable component blocks (doors, windows, symbols) or creating block definitions, use manage_blocks. For creating paperspace presentation sheets, title blocks, and viewports, use manage_layouts. For attaching external DWG references or raster underlays, use manage_xrefs.
Shorthand Grammar (one entity specification per line): line|start|end|color|layer → line|0,0|10,10|red|walls circle|center|radius|color → circle|5,5|3|blue rect|corner1|corner2|color → rect|0,0|20,15 text|pos|text|height|color → text|5,5|Hello|2.5 arc|center|radius|start|end → arc|0,0|5|0|90 polyline|points(;)|closed|color → polyline|0,0;10,10;20,0|closed spline|points(;)|closed|color → spline|0,0;5,10;10,0 dimension|start|end|color → dimension|0,0|10,0 leader|points|text|height|color|layer → leader|0,0;10,10|Note|2.5|red leader|group1group2...|text|height|color → leader|0,0;10,10~~0,0;-10,10|Note table|ins|rows|cols|row_h|col_w|title|headers|data → table|0,0|4|3|3|15|Precios|Item;Cant;Val|Acero;10;150~~Mano;5;120
Defaults: color=white, layer=0.
Coordinates: "x,y" or "x,y,z". Points in a polyline/leader: semicolon-separated "0,0;10,10". Parameters: Returns:
JSON string with created entity handles, status, and summary count. |
| manage_layersA | Create, modify, toggle visibility, restyle, and apply standardized AECO layer templates. Behavior: Mutation: Mutates drawing layer table (creates layers, renames, changes colors, sets lineweights). Destructive Actions: Flag delete|name as destructive; removes target layer definition (layer cannot contain entities or be active layer 0). Persistence: Layer definitions, visibility states, colors, and lineweights persist in DWG/DXF database. Side Effects: Toggling layers (on/off) updates viewport entity visibility immediately.
Usage Guidelines: When to Use: Call to organize drawing structure, enforce architectural CAD layer standards (template|aeco), isolate or hide geometry, set lineweights, or create target layers before drawing. Sibling Routing / Alternatives: For creating geometry on specific layers, use draw_entities(entities="line|...|layer"). For moving existing entities between layers, use manage_entities(operations="set_layer|..."). For paperspace layout sheets and viewports, use manage_layouts.
Shorthand Grammar: create|name|color|lineweight: Create new layer (e.g. create|walls|red|50). delete|name: Delete empty layer (destructive). rename|old|new: Rename existing layer. on|names: Turn on layers (comma-separated, e.g. on|walls,doors). off|names: Turn off layers (e.g. off|furniture). set_color|name|color: Change layer color (e.g. set_color|walls|red). template|preset: Batch-create standard layer palette (presets: aeco/cte, aia, mep). is_on|name: Query if layer is currently visible. list: List all layers in drawing. info: Detailed layer summary with colors and states.
Defaults: color=white, lineweight=25 (0.25mm), template preset=aeco. Parameters: Returns:
JSON string containing per-operation execution results, layer list, and status. |
| manage_filesA | Open, save, create, close, list, and switch active CAD drawing files (.dwg, .dxf). Behavior: Mutation: Modifies document collection state. save writes files to disk; new initializes fresh drawing; close unloads drawing from CAD memory. Destructive Actions: Flag close|false as destructive if unsaved changes exist (discards edits without saving). Persistence: Saves document files permanently to disk in DWG or DXF formats. Side Effects: Switches active document context for all subsequent CAD operations.
Usage Guidelines: When to Use: Call to manage CAD file lifecycle (create blank drawing, save backup or work in progress, list open files, close tab, or switch active drawing). Sibling Routing / Alternatives: For plotting or exporting data/measurements into PDF, Excel, or BC3, use export_data. For referencing external drawings without opening them as active editing documents, use manage_xrefs. For CAD connection lifecycle (connecting to CAD software, status, undo/redo), use manage_session.
Shorthand Grammar: new: Create a new blank drawing. save|filename|format: Save drawing to disk (formats: dwg, dxf, pdf. Default: dwg). close|save_changes: Close active drawing (save_changes: true/false. Default: false). list: List all currently open drawings and indicate active file. switch|drawing_name: Switch active document focus to specified open drawing.
Parameters: Returns:
JSON string containing per-operation execution results, active file names, and status. |
| manage_entitiesA | Modify, select, transform, restyle, compute areas, and manage existing drawing entities. Behavior: Mutation: Mutates drawing entities (positions, rotations, layers, colors, attributes). Destructive Actions: Flag delete|handles as DESTRUCTIVE; permanently deletes specified entity handles from drawing. Persistence: Geometric modifications persist in drawing database upon save. Side Effects: copy/paste accesses internal CAD clipboard buffers; area_table creates a new AutoCAD schedule table.
Usage Guidelines: When to Use: Call to modify existing drawing elements (select, move, rotate, scale, change color/layer, copy, paste, delete, measure area, insert area schedule table). Sibling Routing / Alternatives: For creating new geometry from scratch, use draw_entities. For inserting or creating reusable blocks, use manage_blocks. For whole-drawing spatial inspection or raycasting without modifying anything, use inspect_drawing. For layer lifecycle (create/delete layers, template application), use manage_layers.
Shorthand Grammar (one command per line or semicolon-separated): select|by|value → select|layer|walls (by: color, layer, type) move|handles|offset_x|offset_y → move|A1,B2|10|5 rotate|handles|angle|cx|cy → rotate|A1|45|0|0 (angle in degrees) scale|handles|factor|cx|cy → scale|A1|2.0|0|0 set_color|handles|color → set_color|A1,B2|red set_layer|handles|layer → set_layer|A1|walls set_color_bylayer|handles → set_color_bylayer|A1,B2 copy|handles → copy|A1,B2 paste|base_point → paste|100,200 delete|handles → delete|A1,B2 (DESTRUCTIVE) area|handles → area|A1,B2 (or area|layer|A-ROOMS) area_table|ins_x,ins_y|layer → area_table|0,0|A-ROOMS|Cuadro Áreas
Parameters: Returns:
JSON string containing per-operation execution results, affected handles, and status. |
| manage_blocksA | Create, insert, inspect, and manage reusable CAD blocks and attribute tags. Behavior: Mutation: Mutates drawing by adding block definitions (create), inserting block references (insert), or updating attribute tags (set_attrs). list, info, and get_attrs are read-only. Persistence: Block definitions and inserted instances persist in the DWG/DXF database. Side Effects: Auto-creates destination layer if nonexistent during insert.
Usage Guidelines: When to Use: Call to insert reusable standard components (doors, windows, sanitaryware, electrical symbols, furniture), inspect block library definitions, or read/write block attribute tags (e.g. door width, fire rating). Sibling Routing / Alternatives: For drawing primitive 2D geometry (lines, rectangles, polylines), use draw_entities. For transforming or deleting arbitrary entity instances, use manage_entities. For external project references linked as DWG files, use manage_xrefs.
Shorthand Grammar: list: List all block definitions in drawing. info|block_name|include: Get definition details and reference count (include: info, references, both). insert|name|point|scale|rotation|layer|color: Insert block instance at point (e.g. insert|Door|10,20|1.5|90|walls|red). create|name|handles|base_point|description: Create new block definition from existing entity handles. get_attrs|handle: Query attribute key/value dictionary from a block reference handle. set_attrs|handle|attributes_json: Set attribute values on a block reference handle (e.g. set_attrs|A1|{"TAG":"val"}).
Defaults: scale=1.0, rotation=0, layer=0, color=white. Parameters: Returns:
JSON string containing per-operation execution results, block details, and inserted handles. |
| export_dataA | Extract drawing measurements, bill of quantities, budget standards, or plot vector PDF sheets. Behavior: Mutation: Strictly read-only for drawing geometry; does not alter CAD entities or model database. Persistence: When format is "excel", "bc3", or "pdf", writes persistent files to configured output directory. Side Effects: Filesystem file creation/overwrite in output directory. If format="json", purely returns in-memory payload without disk writes.
Usage Guidelines: When to Use: Call to extract structured quantity takeoffs, generate Excel spreadsheets (.xlsx), export Spanish AECO construction budgets (.bc3 FIEBDC-3), plot publication vector PDFs (.pdf), or retrieve JSON drawing entities. Sibling Routing / Alternatives: For extracting thermal envelope parameters specifically formatted for energy certification in CE3X, use export_ce3x_envelope. For interactive browser visualization of the plan, use show_drawing_viewer. For spatial queries or bounding box summaries, use inspect_drawing.
Parameters: scope: Entity selection scope ("all", "selected"). Default: "all". format: Output serialization format ("json", "excel", "bc3", "pdf"). Default: "json". "json": Returns parsed entity array directly to LLM context. "excel": Generates multi-tab Excel workbook with layer summaries, lengths, and areas. "bc3": Generates standard FIEBDC-3/2020 budget and measurement exchange file. "pdf": Plots modelspace/paperspace to standard vector PDF 1.4 document.
filename: Output file name or relative path (e.g. "mediciones.xlsx", "presupuesto.bc3", "plano.pdf"). paper_size: Paper standard when format="pdf" ("A4", "A3", "A2", "A1", "A0"). Default: "A3".
Returns:
JSON string containing export summary, file path, exported entity counts, or extracted entity data. |
| prompt_userA | Prompt the human user for interactive mouse clicks, coordinate picking, or command line input in CAD. Behavior: Mutation: Strictly read-only for drawing geometry; does not alter drawing database. Persistence: No persistent side effects or disk modifications. Side Effects: Pauses execution to display prompt message in CAD command line and crosshair cursor, awaiting user mouse click or keyboard input. Captures ESC / cancellation gracefully.
Usage Guidelines: When to Use: Call for Human-in-the-Loop workflows whenever the AI needs the user to click a coordinate on screen, pick an entity visually with the crosshairs, measure a distance interactively, or confirm a string prompt. Sibling Routing / Alternatives: For automated programmatic coordinate queries without user intervention, use inspect_drawing. For selecting entities programmatically by layer/color/type, use manage_entities(operations="select|..."). For launching an interactive web-based canvas viewer in the browser, use show_drawing_viewer.
Shorthand Grammar: point|message|[base_x,base_y]: Prompts user to click a point in CAD viewport (e.g. point|Click door hinge point). entity|message: Prompts user to click an entity on screen (returns entity handle, type, and layer). distance|message|[base_point]: Prompts user to pick two points or measure distance in CAD. string|message: Prompts user to type text in CAD command bar.
Parameters: Returns:
JSON string containing user response, picked coordinates (x, y, z), picked entity handles, or cancellation status. |
| manage_xrefsA | Manage external CAD references (DWG XREFs) and raster cartography or orthophoto underlays. Behavior: Mutation: Modifies drawing reference table and external block definitions. Destructive Actions: Flag detach|name as destructive; removes reference link and unbinds geometry/images from drawing. Persistence: XREF and raster link paths persist in DWG/DXF database upon save. Side Effects: Reads external files from disk at specified paths during attachment.
Usage Guidelines: When to Use: Call to overlay external project files (structural models, MEP designs, topographies, aerial orthophotos, scans) as linked external references without duplicating geometry. Sibling Routing / Alternatives: For inserting self-contained reusable CAD blocks embedded in the current drawing, use manage_blocks. For opening, saving, or switching between independent drawing documents, use manage_files.
Shorthand Grammar: attach|path|[x,y]|[scale]|[rotation]: Attach DWG external reference. raster|path|[x,y]|[scale]: Attach raster image underlay (PNG, JPG, TIFF). list: List all currently attached XREFs and raster images. reload|name: Reload updated external reference file from disk. detach|name: Unlink and remove reference from drawing (destructive).
Parameters: Returns:
JSON string with operation status, attached reference names, and paths. |
| export_ce3x_envelopeA | Extract CAD thermal building envelope parameters for CE3X energy certification. Behavior: Mutation: Strictly read-only for CAD geometry; does not alter drawing database or active viewport. Persistence: Saves a standardized JSON envelope file to the configured output directory. Side Effects: Filesystem write of the output JSON file.
Usage Guidelines: When to Use: Call when bridging CAD floor plans to energy certification workflows (CE3X-MCP-SERVER, CTE DB-HE, or RD 390/2021). Computes exterior wall surface areas, wall azimuth orientations (N, S, E, W) by normal vector geometry, associated window openings, and usable floor area. Sibling Routing / Alternatives: For generic drawing takeoffs, Excel spreadsheets, or FIEBDC-3 budgets, use export_data. For spatial queries or room area schedules without thermal calculations, use inspect_drawing or manage_entities(operations="area|...").
Parameters: wall_height: Clear floor-to-ceiling height in meters. Default: 2.70. climate_zone: CTE climate zone (e.g., "A3", "C1", "D3"). Default: "C1". building_type: Building typology ("vivienda_individual", "bloque_viviendas", "terciario"). Default: "vivienda_individual". filename: Output JSON filename. Default: "envolvente_ce3x.json".
Returns:
JSON string containing CTE thermal envelope parameters, ready for direct ingestion by CE3X-MCP-SERVER. |
| inspect_drawingA | Inspect spatial intelligence, dimensions, geometric intersections, and object snaps. Behavior: Mutation: Strictly read-only; does not modify drawing entities, layers, or CAD state. Persistence: No persistent side effects or disk modifications. Side Effects: Computes spatial relationships in-memory from active CAD or DXF model.
Usage Guidelines: When to Use: Call whenever the AI needs spatial intelligence (drawing extents, room schedules, what entity is located at coordinate X,Y, line crossings, or nearest snap points). Sibling Routing / Alternatives: For launching an interactive graphical web viewer for human visual inspection, use show_drawing_viewer. For computing area or measuring specific entity handles, use manage_entities(operations="area|..."). For requesting interactive human mouse clicks in the CAD viewport, use prompt_user.
Modes & Parameters: mode: Inspection mode ("summary", "point", "intersections", "snap"). Default: "summary". "summary": Global bounding box, room schedule, layer inventory, and ASCII minimap. "point": Point-in-polygon raycasting query ("what room/space contains point X,Y?"). Requires point="x,y". "intersections": Detect geometric crossings between entities. Optional: handle1, handle2, layer. "snap": Object snap assistant. Finds closest endpoint, midpoint, or center to point. Requires point="x,y".
point: Coordinates "x,y" or "x,y,z" (required for "point" and "snap" modes). handle1: Optional first entity handle to restrict intersection checks. handle2: Optional second entity handle to test intersection against handle1. snap_types: Comma-separated snap filters: "endpoint", "midpoint", "center". Default: "endpoint,midpoint,center". tolerance: Search radius for snap points in drawing units. Default: 1.5. layer: Optional layer name to filter intersection candidates.
Returns:
JSON string with mode-specific spatial data, coordinates, and matched entities. |
| show_drawing_viewerA | Generate and launch an interactive HTML5 CAD Canvas viewer in the web browser. Behavior: Mutation: Strictly read-only for CAD geometry; does not alter drawing database or active viewport. Persistence: Saves a standalone HTML viewer file to the configured output directory. Side Effects: Writes a self-contained HTML file to local disk. If open_browser is True, spawns an external process to open the system default web browser.
Usage Guidelines: When to Use: Call when a human user requests interactive visual exploration, panning/zooming, or clicking on rooms/layers in a graphical UI. Sibling Routing / Alternatives: For programmatic spatial queries (bounding box, point raycasting, snap points, ASCII map), use inspect_drawing. For exporting static documents or publication files (vector PDF, BC3, Excel), use export_data. For controlling viewport zoom/camera inside the active CAD software window, use manage_view.
Parameters: Returns:
JSON string with status, absolute HTML file path, entity count, and browser launch result. |
| manage_annotationsA | Create automated architectural annotations, centroid room labels, and linear dimension chains. Behavior: Mutation: Mutates drawing by generating and placing new annotation text, dimensions, and leaders. Persistence: Inserted annotations persist in DWG/DXF database upon save. Side Effects: Auto-creates destination annotation layers (e.g. A-ANNO-TEXT, A-ANNO-DIMS) if nonexistent.
Usage Guidelines: When to Use: Call to automatically label room centroids with computed areas (m²), generate overall or wall-by-wall linear dimension chains, or add leader callouts with arrowheads. Sibling Routing / Alternatives: For manually drafting single primitive dimensions or leaders with custom points, use draw_entities(entities="dimension|... / leader|..."). For modifying, moving, restyling, or deleting existing annotation entities, use manage_entities. For room scheduling tables, use manage_entities(operations="area_table|...").
Actions & Parameters: "label_spaces": Places text label with room name and computed area at centroid of closed room spaces. "auto_dimension": Generates exterior linear dimension chain along bounding box or wall segments. "add_leader": Inserts architectural callout leader pointing to specified geometry.
Parameters: action: Action to perform ("label_spaces", "auto_dimension", "add_leader"). Default: "label_spaces". handles: Optional entity handle or list of handles to annotate. If None, processes all spaces. style: Dimensioning style for "auto_dimension" ("overall" for global extents, "segments" for each wall). Default: "overall". offset: Offset distance in drawing units between geometry and dimension line. Default: 1.0. text_height: Text height for labels and dimensions in drawing units. Default: 0.35. prefix: Text prefix added before calculated area value (e.g. "Sup = "). Default: "". suffix: Text suffix appended after area value. Default: " m²". layer: Target layer name (default: "A-ANNO-TEXT" for space labels, "A-ANNO-DIMS" for dimensions). color: Optional color name or ACI number.
Returns:
JSON string containing created annotation handles, count, and status. |
| manage_layoutsA | Manage AutoCAD paperspace layouts, presentation sheets, viewports, and AECO title blocks. Behavior: Mutation: Mutates paperspace configurations, layout dictionaries, and sheet entities. Destructive Actions: Flag action="delete" as DESTRUCTIVE; permanently removes target layout sheet and all entities/viewports placed upon it. Cannot delete active layout or "Model" tab. Persistence: Layout definitions and viewport scales persist in drawing database upon save. Side Effects: Switches active tab in CAD interface when action="activate" or action="create" is called.
Usage Guidelines: When to Use: Call to compose architectural presentation sheets, configure standard paper formats (A4-A0), insert scaled modelspace viewports, add standardized title blocks, or switch active sheets. Sibling Routing / Alternatives: For adjusting camera zoom, pan, or visual style inside active modelspace viewport, use manage_view. For exporting or plotting finished sheet to vector PDF document, use export_data(format="pdf"). For creating 2D/3D geometry in modelspace, use draw_entities.
Actions & Per-Action Required Parameters: "create": Create new layout sheet with border frame, viewport, and title block. "list": List all layouts in drawing with active status. "activate": Switch active CAD workspace tab to this layout. "delete": (DESTRUCTIVE) Permanently delete named layout sheet. "add_viewport": Add architectural viewport to existing layout. "add_titleblock": Add AECO standard title block with metadata.
Parameters: action: Action to perform ("create", "list", "activate", "delete", "add_viewport", "add_titleblock"). Default: "create". name: Layout sheet name (e.g. "Plano_01_Distribucion"). paper_size: Paper standard ("A4", "A3", "A2", "A1", "A0", "LETTER", "TABLOID"). Default: "A3". orientation: Sheet orientation ("landscape", "portrait"). Default: "landscape". scale: Architectural scale ("1:50", "1:100", "1:20", "1:200", "1:500", "1:10", "1:1"). Default: "1:50". model_center: Center coordinate in modelspace to focus ("x,y", e.g. "15.0, 10.0"). viewport_rect: Viewport center and dimensions in paper mm ("cx,cy,w,h", e.g. "210,148,380,260"). title: Project or sheet title for title block. author: Designer, collegiate engineer, or author name. date: Date string for title block. sheet_number: Sheet index or code (e.g. "PL-01", "1/4"). Default: "1/1". unit: Model units ("m" for meters, "mm" for millimeters). Default: "m".
Returns:
JSON string with action result, layout details, and success status. |