Reference Index

1. Connection & Setup Guide

The MLabs Revit MCP Server provides a standardized Model Context Protocol (MCP) interface for Autodesk Revit. Communication occurs over local Windows Named Pipes, allowing AI agents to query elements, extract schedules, capture views, inspect connectors, and execute model modifications without transmitting proprietary BIM files to external servers.

1.1 Overview & Architecture

The MLabs MCP infrastructure consists of two local components:

  • Revit In-Process MCP Host: Runs directly inside Autodesk Revit under the MLabs add-in framework. It listens on a full-duplex Windows Named Pipe (\.pipeRevitMcpPipe). Incoming operations are dispatched onto the Revit main UI thread using the native ExternalEvent bridge, guaranteeing thread safety across all API calls.
  • Standalone MCP Server Executable (RevitMcpServer.exe): A dedicated background process implementing the MCP protocol specification over standard I/O (stdio). AI clients launch and communicate with this executable, which bridges requests directly to Revit via the named pipe.
Local Data Security: Communication between your AI desktop client, RevitMcpServer.exe, and Autodesk Revit takes place entirely within the local workstation. No model elements, geometry, or family properties are transmitted to cloud endpoints by the MCP server.

1.2 Automated 1-Click Setup via Revit Ribbon

The add-in includes a graphical Revit MCP Server Manager to automatically configure installed AI desktop clients:

  1. Launch Autodesk Revit with the MLabs MEP add-in active.
  2. Navigate to the MLabs tab on the Ribbon interface.
  3. Under the MCP Server panel, click the MCP Server button.
  4. The Revit MCP Server Manager window will display the installation status of supported AI clients on your workstation (Claude Desktop, Antigravity, and ChatGPT Desktop).
  5. Click Install MCP next to the desired client. The manager automatically reads the client’s configuration file, registers the Revit-MCP server entry with the correct executable path, and saves the file.

1.3 Mandatory AI Agent Restart

CRITICAL REQUIREMENT: RESTART AI AGENTS

If your AI agent client (Claude Desktop, Antigravity, Cursor, Windsurf, or ChatGPT Desktop) is open when the configuration is applied, you must completely exit and restart the AI agent application.

AI agent clients read MCP server configurations and initialize server child processes only during application launch. If the application is not restarted, the newly registered Revit-MCP tools will not be recognized in your conversation context.

1.4 Verifying Connection

To confirm that your AI client is connected to Revit, send the following prompt in chat:

Ping Revit or execute the ping / mlabs_ping tool.

When connected, Revit responds with diagnostic metadata including Revit version, MLabs plugin build, active document title, and response latency.


2. System Diagnostics & Connectivity

Tools for testing live server connectivity, retrieving Revit session information, and verifying IPC communication.

TOOL

ping

Check connectivity to Revit, retrieve Revit version, MLabs plugin status, and active document/view details. (Full session diagnostic equivalent to mlabs_ping).

This tool accepts no arguments. Pass an empty object {}.

Example Invocation

{}
TOOL

mlabs_ping

Check connectivity to Revit, retrieve Revit version, MLabs plugin status, and active document/view details. (Equivalent to ping).

This tool accepts no arguments. Pass an empty object {}.

Example Invocation

{}

3. Project & Document Lifecycle Management

Tools for querying open projects, opening files, saving models, synchronizing with central, and closing projects.

TOOL

get_active_document_info

Retrieve active Revit document title, path, active view name, and project status.

This tool accepts no arguments. Pass an empty object {}.

Example Invocation

{}
TOOL

list_open_projects

Retrieve a list of all documents/projects currently open in the Revit session, including active status, title, path, and worksharing state.

This tool accepts no arguments. Pass an empty object {}.

Example Invocation

{}
TOOL

open_project

Open a Revit project (.rvt) or family (.rfa) file. Can open and activate in UI or open in background memory.

Parameters

Parameter Type Requirement Description
file_path string Required Full absolute path to the .rvt or .rfa file.
activate boolean Optional Whether to open and activate the project in the Revit UI. Default is true.
detach_from_central boolean Optional If workshared, whether to detach the model from central. Default is false.

Example Invocation

{
  "file_path": "C:\\Projects\\MedicalCenter_Phase2.rvt",
  "activate": true,
  "detach_from_central": false
}
TOOL

save_project

Save or Synchronize with Central for the active Revit project or a specified project by title.

Parameters

Parameter Type Requirement Description
project_title string Optional Title of the project to save. If omitted, saves the currently active project.
save_as_path string Optional Optional path to perform Save As. Required if project has never been saved.
sync_central boolean Optional If true and the model is workshared, performs Synchronize with Central instead of standard save. Default is false.
compact boolean Optional Whether to compact the file upon saving. Default is false.
comment string Optional Optional comment when synchronizing with central.

Example Invocation

{
  "sync_central": true,
  "compact": true,
  "comment": "Aligned sanitary piping layout on Level 2"
}
TOOL

close_project

Close a specific Revit project by title or close all open projects except a specified project (close_all_except).

Parameters

Parameter Type Requirement Description
project_title string Optional Title of the specific project to close.
close_all_except string Optional Title of the project to KEEP open. All other open projects will be closed. Example: ‘Project1’ closes everything except Project1.
save_changes boolean Optional Whether to save changes before closing. Default is false.

Example Invocation

{
  "project_title": "Site_Context.rvt",
  "save_changes": false
}

4. Viewport & View Management

Tools for discovering views, listing open view tabs, switching active viewports, and closing inactive windows.

TOOL

list_views

List non-template views in the active Revit project with optional filtering by view_type and search_keyword. Includes token protection with max_results (default 100).

Parameters

Parameter Type Requirement Description
view_type string Optional Optional ViewType filter: ‘FloorPlan’, ‘CeilingPlan’, ‘Elevation’, ‘Section’, ‘ThreeD’, ‘Schedule’, ‘DrawingSheet’, ‘DraftingView’, ‘Legend’, or ‘All’ (default).
search_keyword string Optional Optional case-insensitive substring filter for view name (e.g. ‘Level 1’, ‘Mặt bằng’, ‘Section’).
max_results integer (Int64) Optional Maximum number of views to return to prevent token overflow (default: 100, max: 200).
offset integer (Int64) Optional Pagination offset index (default: 0).

Example Invocation

{
  "view_type": "FloorPlan",
  "search_keyword": "HVAC",
  "max_results": 25,
  "offset": 0
}
TOOL

list_open_views

Retrieve a list of all currently open UI view windows in the active Revit document, indicating which one is active. To search or list all views in the project (including closed views), use ‘list_views’.

This tool accepts no arguments. Pass an empty object {}.

Example Invocation

{}
TOOL

set_active_view

Switch the active viewport in Revit to a specified view by view_id or view_name. Works for ANY non-template view in the project (FloorPlan, Section, 3D, Schedule, Sheet), even if not currently open in tabs.

Parameters

Parameter Type Requirement Description
view_id integer (Int64) Optional Element ID (Int64/long) of the view to activate.
view_name string Optional Name of the view to activate (case-insensitive exact match).

Example Invocation

{
  "view_name": "Level 1 - Mechanical Plan"
}
TOOL

close_views

Close views in the active Revit document. Set ‘close_inactive’ to true to close all inactive views (equivalent to Revit’s native Close Inactive Views), or specify ‘view_id’ / ‘view_name’ to close a specific open view.

Parameters

Parameter Type Requirement Description
close_inactive boolean Optional If true, closes all open view windows EXCEPT the currently active view. Default is false.
view_id integer (Int64) Optional Element ID (Int64/long) of a specific view window to close.
view_name string Optional Name of a specific view window to close.

Example Invocation

{
  "close_inactive": true
}

5. Model Element Inspection & Querying

Tools for inspecting selected objects, reading deep parameter dictionaries by ID, listing visible viewport elements, querying elements by parameter values, and viewport selection highlighting.

TOOL

get_selected_elements_info

Retrieve detailed properties, geometry bounds, and parameters of currently selected elements in the active Revit project (Revit Lookup style).

Parameters

Parameter Type Requirement Description
include_parameters boolean Optional Whether to include element parameters (default: true).
param_filter string Optional Optional case-insensitive substring filter for parameter names (e.g., ‘diameter’, ‘length’, ‘comments’).
include_type_parameters boolean Optional Whether to include element type parameters (default: true).

Example Invocation

{}
TOOL

inspect_element_by_id

Inspect deep properties, parameters, and type information of specific elements by their Revit Element IDs (Int64/long).

Parameters

Parameter Type Requirement Description
element_ids array of integer Required List of Revit Element IDs (Int64/long) to inspect.
include_parameters boolean Optional Whether to include element parameters (default: true).
param_filter string Optional Optional case-insensitive substring filter for parameter names.
include_type_parameters boolean Optional Whether to include element type parameters (default: true).

Example Invocation

{
  "element_ids": [
    1048291,
    1048295
  ],
  "include_parameters": true,
  "include_type_parameters": true,
  "param_filter": "Dimension"
}
TOOL

get_active_view_elements

List summary information of elements visible in the active view, filtered by category with pagination.

Parameters

Parameter Type Requirement Description
category_names array of string Optional Optional list of Category names to filter (e.g. [‘Pipes’, ‘Ducts’, ‘Pipe Fittings’, ‘Mechanical Equipment’, ‘Walls’]). If omitted, all model elements in view are considered.
limit integer (Int64) Optional Maximum number of elements to return (default: 50, max: 200).
offset integer (Int64) Optional Number of elements to skip for pagination (default: 0).

Example Invocation

{
  "category_name": "Pipes",
  "limit": 50,
  "offset": 0
}
TOOL

query_elements_by_parameter

Search and filter elements by parameter name and value. Supports view scope, category filter, exact/contains/regex matching, and safety limit (Constraint #4).

Parameters

Parameter Type Requirement Description
parameter_name string Required Name of the parameter to search/filter (required, e.g. ‘Comments’, ‘Mark’, ‘System Name’, ‘Diameter’).
filter_value string Required Target value to match against the parameter value (required).
category_name string Optional Optional Category name filter (e.g. ‘Pipes’, ‘Ducts’, ‘Mechanical Equipment’).
match_mode string Optional Matching mode: ‘exact’ (default), ‘contains’, or ‘regex’.
limit integer (Int64) Optional Maximum matching elements to return (default: 100, max: 500).
view_id integer (Int64) Optional Optional View Element ID (Int64/long). If provided, restricts query to elements visible in this view.

Example Invocation

{
  "parameter_name": "Comments",
  "filter_value": "VAV-101",
  "match_mode": "contains",
  "category_name": "Ducts"
}
TOOL

highlight_and_select_elements

Highlight, select, and optionally zoom-to-fit specified elements in the active view so the user can verify changes visually.

Parameters

Parameter Type Requirement Description
element_ids array of integer Required List of Revit Element IDs (Int64/long) to select.
zoom_to_fit boolean Optional Whether to zoom active view to fit the selected elements (default: true).

Example Invocation

{
  "element_ids": [
    1048291,
    1048295
  ],
  "zoom_to_fit": true
}

6. Visual Capture & Viewport Inspection

Tools for exporting high-resolution view snapshots, capturing GDI+ screenshots of schedule tables and sheets, and generating isolated 3D element snapshots.

TOOL

capture_active_view

Capture high-quality snapshot of the active view (or a specified view by ID) using Revit API native export (DPI 150, 1280-1568px). NOTE: For 2D Plan/Section/Elevation and 3D Model views only. For Schedules and Sheets, use ‘capture_revit_screenshot’.

Parameters

Parameter Type Requirement Description
view_id integer (Int64) Optional Optional View Element ID (Int64/long). If omitted, exports the currently active view.
pixel_size integer (Int64) Optional Output image width/height in pixels (default: 1440, constrained between 1280 and 1568).

Example Invocation

{
  "pixel_size": 1568
}
TOOL

capture_revit_screenshot

Capture actual viewport/schedule screenshot from Revit UI (drawing area or full window) via GDI+ CopyFromScreen. REQUIRED for visual inspection of Schedules and Sheets, or when capturing the entire Revit UI.

Parameters

Parameter Type Requirement Description
capture_scope string Optional Capture scope: ‘drawing_area’ (default, active view/schedule canvas inside Revit) or ‘full_window’ (entire Revit application window).
target_view_id integer (Int64) Optional Optional View ID (Int64/long). If provided and different from active view, switches active view to this view before capturing.

Example Invocation

{
  "capture_scope": "viewport",
  "target_view_id": 2049182
}
TOOL

capture_elements_isolate

Isolates specified elements in a 3D bounding box snapshot and exports an image. Wraps all modifications in a TransactionGroup with RollBack to protect the Undo stack (Constraint #3).

Parameters

Parameter Type Requirement Description
element_ids array of integer Required List of Revit Element IDs (Int64/long) to isolate and capture (required).
padding_mm number (float) Optional Padding in millimeters around elements for SectionBox (default: 300 mm).
view_orientation string Optional Camera orientation: ‘Isometric’ (default), ‘Top’, ‘Front’, or ‘Right’.
pixel_size integer (Int64) Optional Image size in pixels (default: 1440, constrained between 1280 and 1568).

Example Invocation

{
  "element_ids": [
    1048291,
    1048295
  ],
  "padding_mm": 500.0,
  "pixel_size": 1440
}

7. Schedule Intelligence & Tabular Data

Tools for discovering model component schedules and extracting structured table headers, rows, and cell text.

TOOL

list_schedules

List all Model Component Schedules (Pipes, Ducts, Equipment, etc.) in the project or placed on a specific sheet (Constraint #2).

Parameters

Parameter Type Requirement Description
sheet_id integer (Int64) Optional Optional Sheet Element ID (Int64/long). If provided, only schedules placed on this sheet are returned.

Example Invocation

{
  "sheet_id": 3058291
}
TOOL

get_schedule_data

Read table column structure and cell text from a Model Component Schedule with formatted cell extraction, header cleaning, and optional export engine.

Parameters

Parameter Type Requirement Description
schedule_id integer (Int64) Optional Element ID (Int64/long) of the ViewSchedule to read.
schedule_name string Optional Name of the ViewSchedule to read (used if schedule_id is not provided).
start_row integer (Int64) Optional Zero-based row index to start reading from for pagination (default: 0).
max_rows integer (Int64) Optional Maximum number of body rows to read (default: 50, max: 200).
clean_headers boolean Optional Whether to automatically skip header rows inside Body section and empty spacer rows (default: true).
use_export_engine boolean Optional Whether to use Revit native ViewSchedule.Export engine for 100% UI fidelity on complex grouped tables (default: false).

Example Invocation

{
  "schedule_name": "Pipe Schedule - Level 1",
  "max_rows": 100
}

8. Model Quality & BIM Integrity Auditing

Tools for auditing active document warnings and analyzing MEP network integrity, including unconnected open ends and sloped pipe errors.

TOOL

audit_model_warnings

Audit and extract all active Warnings in the Revit project with grouped statistics, severity, and related element IDs (Int64/long).

Parameters

Parameter Type Requirement Description
severity_filter string Optional Filter by severity: ‘all’ (default), ‘warning’, or ‘error’.
limit integer (Int64) Optional Maximum warning details to return (default: 50, max: 200).

Example Invocation

{
  "severity_filter": "warning",
  "limit": 50
}
TOOL

audit_mep_integrity

Audit MEP model integrity: detect open (unconnected) pipe/duct ends, check slopes, and unassigned MEP systems.

Parameters

Parameter Type Requirement Description
category string Optional Category to audit: ‘All’ (default), ‘Pipes’, ‘Ducts’, ‘CableTrays’, or ‘Conduits’.
check_open_connectors boolean Optional Whether to detect unconnected / open connector ends (default: true).
check_slope boolean Optional Whether to check for zero/negative slopes on sloped MEP pipes (default: true).
view_id integer (Int64) Optional Optional View Element ID (Int64/long). If provided, restricts check to elements in this view.
limit integer (Int64) Optional Maximum number of integrity issues to return (default: 100, max: 500).

Example Invocation

{
  "category": "Pipes",
  "check_open_connectors": true,
  "check_slope": true,
  "limit": 100
}

9. Element Parameter Modification

Tools for modifying individual or batch element parameters with automated unit conversions, dry-run previews, and type parameter protection.

TOOL

set_element_parameter

Modify a single parameter value on an element with automatic unit conversion, dry-run preview, and Type Parameter protection (Constraint #5). For numeric length/size parameters, ‘unit’ defaults to Document units or ‘mm’ (never raw feet). Specify ‘unit’ (e.g. ‘mm’, ‘m’, ‘deg’) explicitly for maximum precision.

Parameters

Parameter Type Requirement Description
element_id integer (Int64) Required Revit Element ID (Int64/long) to modify (required).
parameter_name string Optional Name of the parameter to modify (e.g. ‘Comments’, ‘Mark’, ‘Diameter’, ‘Length’).
parameter_id integer (Int64) Optional Optional Parameter ID (Int64/long). Supports BuiltInParameter (negative) or Project/Shared Parameter ID to resolve duplicate names.
new_value any Required New value to assign. Supports string, number (double/int), or boolean.
unit string Optional Optional unit for numeric values (e.g. ‘mm’, ‘m’, ‘cm’, ‘inch’, ‘deg’). If omitted, automatically resolves from Document units or defaults to ‘mm’ (never raw feet).
allow_type_parameter boolean Optional Whether to allow modifying Type Parameters if not found on instance (default: false). Protects against changing all family instances.
dry_run boolean Optional If true, simulates the change and validates it, then rolls back the transaction. No changes committed to the model (default: false).

Example Invocation

{
  "element_id": 1048291,
  "parameter_name": "Comments",
  "new_value": "Inspected & Approved",
  "allow_type_parameter": false,
  "dry_run": false
}
TOOL

batch_set_element_parameters

Modify multiple element parameters atomically within a single Transaction. Supports dry-run validation, unit safety (defaults to doc units or mm), and type parameter safeguards (Constraint #5).

Parameters

Parameter Type Requirement Description
updates array of object Required List of parameter update requests.
↳ updates[].element_id integer (Int64) Required Revit Element ID (Int64/long).
↳ updates[].parameter_name string Optional Parameter name to modify.
↳ updates[].parameter_id integer (Int64) Optional Optional Parameter ID (Int64/long).
↳ updates[].new_value any Required New value to assign.
↳ updates[].unit string Optional Optional unit (e.g. ‘mm’, ‘m’, ‘deg’). If omitted, defaults to doc units or ‘mm’.
↳ updates[].allow_type_parameter boolean Optional Allow modifying Type Parameter for this item.
transaction_name string Optional Optional custom name for the Revit Undo transaction.
allow_type_parameter boolean Optional Global default flag for whether to allow modifying Type Parameters (default: false).
dry_run boolean Optional If true, simulates all changes and rolls back without committing (default: false).
stop_on_first_error boolean Optional If true, rolls back entire batch if any single update fails (default: false).

Example Invocation

{
  "transaction_name": "Update Pipe Insulation",
  "allow_type_parameter": false,
  "dry_run": false,
  "stop_on_first_error": false,
  "updates": [
    {
      "element_id": 1048291,
      "parameter_name": "Insulation Thickness",
      "new_value": 25.0,
      "unit": "mm"
    },
    {
      "element_id": 1048295,
      "parameter_name": "Insulation Thickness",
      "new_value": 25.0,
      "unit": "mm"
    }
  ]
}

10. Annotation & Autonomous Tagging

Tools for visual-first element tagging pre-inspection, batch tag placement, inspecting placed tag coordinates, repositioning tag heads/elbows, and orthogonal leader alignment.

TOOL

inspect_elements_for_tagging

Visual-First SoM Pre-inspection: Scans active view for elements of a given category (default: ‘Plumbing Fixtures’), temporarily labels them P1..Pn, exports a high-resolution PNG snapshot for AI spatial reasoning, and rolls back the transaction leaving model untouched.

Parameters

Parameter Type Requirement Description
category_name string Optional Category to inspect (e.g. ‘Plumbing Fixtures’, ‘Pipes’, ‘Mechanical Equipment’). Default: ‘Plumbing Fixtures’.
pixel_size integer (Int64) Optional Snapshot image resolution in pixels (default: 1440, min: 1280, max: 2048).

Example Invocation

{
  "category_name": "Plumbing Fixtures",
  "pixel_size": 1440
}
TOOL

tag_elements_in_view

Batch tags elements in the active view (with leader enabled). Supports specific element IDs or all visible elements of category. Returns placed tag metadata and an updated snapshot image.

Parameters

Parameter Type Requirement Description
category_name string Optional Category to tag if element_ids not supplied (default: ‘Plumbing Fixtures’).
element_ids array of integer Optional Optional explicit list of Element IDs (long) to tag.
tag_type_id integer (Int64) Optional Optional FamilySymbol ID (long) of the tag type to use.
leader_mode string Optional ‘Attached’ (default) or ‘Free’.
initial_offset_mm number (float) Optional Initial head offset distance from element center in mm (default: 400).
offset_direction string Optional Direction of initial offset: ‘Top’ (default), ‘Bottom’, ‘Left’, ‘Right’.
capture_snapshot boolean Optional Whether to capture view screenshot immediately after tagging (default: true).

Example Invocation

{
  "category_name": "Plumbing Fixtures",
  "element_ids": [
    1048291,
    1048295
  ],
  "leader_mode": "attached",
  "initial_offset_mm": 350.0,
  "offset_direction": "top_right",
  "capture_snapshot": true
}
TOOL

inspect_tags_in_view

Inspects existing tags in active view (by host category or tag category). Returns precise TagHeadPosition, LeaderElbow, LeaderEnd, bounding box size, and view snapshot.

Parameters

Parameter Type Requirement Description
category_name string Optional Target host category to filter (e.g. ‘Plumbing Fixtures’). If omitted, retrieves all tags.
pixel_size integer (Int64) Optional Resolution for exported snapshot image (default: 1440).

Example Invocation

{
  "category_name": "Plumbing Fixtures",
  "pixel_size": 1440
}
TOOL

adjust_tags

Applies batch spatial coordinates to TagHead and LeaderElbow. Accepts coordinates in millimeters (default) or internal feet. Returns updated tag status and fresh verification snapshot.

Parameters

Parameter Type Requirement Description
in_millimeters boolean Optional Whether coordinates are supplied in millimeters (default: true). If false, feet is assumed.
auto_perpendicular boolean Optional Whether to automatically snap leader elbows to perpendicular orthogonal angles after moving tag head (default: true).
capture_verification boolean Optional Whether to capture an updated verification snapshot after adjustment (default: true).
adjustments array of object Required List of tag adjustments.
↳ adjustments[].tag_id integer (Int64) Required Element ID (long) of the IndependentTag.
↳ adjustments[].head_x number (float) Required New X coordinate for TagHead.
↳ adjustments[].head_y number (float) Required New Y coordinate for TagHead.
↳ adjustments[].head_z number (float) Optional New Z coordinate for TagHead (optional, defaults to 0/view plane).
↳ adjustments[].elbow_x number (float) Optional New X coordinate for LeaderElbow (optional).
↳ adjustments[].elbow_y number (float) Optional New Y coordinate for LeaderElbow (optional).
↳ adjustments[].elbow_z number (float) Optional New Z coordinate for LeaderElbow (optional).
↳ adjustments[].elbow_type string Optional Optional orthogonal fold style: ‘HorizontalFirst’ or ‘VerticalFirst’.
↳ adjustments[].auto_perpendicular boolean Optional Whether to snap this tag’s leader perpendicular (default: true).
↳ adjustments[].end_x number (float) Optional New X coordinate for LeaderEnd (optional, for Free leader mode).
↳ adjustments[].end_y number (float) Optional New Y coordinate for LeaderEnd (optional).
↳ adjustments[].end_z number (float) Optional New Z coordinate for LeaderEnd (optional).
↳ adjustments[].leader_mode string Optional ‘Attached’ or ‘Free’ (optional).

Example Invocation

{
  "in_millimeters": true,
  "auto_perpendicular": true,
  "capture_verification": true,
  "adjustments": [
    {
      "tag_id": 1059382,
      "head_x_mm": 12500.0,
      "head_y_mm": 8400.0,
      "elbow_x_mm": 12200.0,
      "elbow_y_mm": 8400.0
    }
  ]
}
TOOL

make_tags_perpendicular

Snaps tag leaders in the active view to 90-degree orthogonal perpendicular angles with Attached End. Based on MLabs MakePerpendicular algorithm. Accepts specific tag IDs or all tags in active view.

Parameters

Parameter Type Requirement Description
tag_ids array of integer Optional Optional list of tag Element IDs (long) to snap. If omitted, all tags of category in view are snapped.
category_name string Optional Category name if tag_ids omitted (default: ‘Plumbing Fixtures’).
elbow_type string Optional Optional fold style: ‘HorizontalFirst’, ‘VerticalFirst’, or ‘Auto’ (default: Auto).
capture_verification boolean Optional Whether to capture an updated verification snapshot (default: true).

Example Invocation

{
  "category_name": "Plumbing Fixtures",
  "elbow_type": "horizontal_first",
  "capture_verification": true
}

11. Continuous Wall Dimensioning

Tools for identifying visible wall segments, creating continuous multi-segment dimension chains along wall faces, and fine-tuning dimension lines and text positions.

TOOL

inspect_walls_with_visual_tags

Visual-First Inspection (SoM): Detects all visible walls in active view, classifies their orientation, temporarily tags them W1..Wn at midpoints with boundary markers [TOP],[BOTTOM],[LEFT],[RIGHT], exports a high-res PNG, and rolls back transaction leaving the model untouched.

Parameters

Parameter Type Requirement Description
pixel_size integer (Int64) Optional Resolution width/height in pixels for exported snapshot (default: 1440, min: 1280, max: 2048).

Example Invocation

{
  "pixel_size": 1440
}
TOOL

create_wall_dimension_chains

Creates multi-segment continuous chain dimensions for grouped parallel walls from Exterior and Interior faces, projects line onto view plane, auto-staggers narrow segment texts (<=450mm), and optionally stacks an overall dimension.

Parameters

Parameter Type Requirement Description
chains array of object Required List of dimension chains to create.
↳ chains[].chain_id string Required Chain identifier (e.g. ‘C1’, ‘C2’).
↳ chains[].wall_aliases array of string Required List of wall aliases (‘W1’, ‘W4’) or Element IDs (‘12536418’) belonging to this parallel group.
↳ chains[].measurement_type string Optional ‘ChainAndThickness’ (measures both faces of all walls in chain + spans) or ‘SingleWallLength’ (measures single wall length).
↳ chains[].placement_side string Required Placement side relative to the wall group: ‘Top’, ‘Bottom’, ‘Left’, ‘Right’.
↳ chains[].offset_mm number (float) Optional Offset distance from outermost wall boundary in mm (default: 700).
↳ chains[].include_overall boolean Optional Whether to stack an overall dimension line encompassing the entire chain (default: true).
↳ chains[].stack_spacing_mm number (float) Optional Spacing between detail chain and overall dimension line in mm (default: 400).
↳ chains[].auto_stagger_narrow_text boolean Optional Whether to stagger text positions for segments <= 450mm to prevent overlap (default: true).
↳ chains[].dimension_type_id integer (Int64) Optional Optional DimensionType ElementId (Int64).

Example Invocation

{
  "chains": [
    {
      "wall_ids": [
        1048100,
        1048105,
        1048110
      ],
      "dimension_face": "exterior",
      "offset_distance_mm": 800.0,
      "chain_type": "continuous"
    }
  ]
}
TOOL

adjust_dimensions

Fine-tune dimension lines and segment text positions: move dimension line perpendicular to its axis, offset specific segment TextPosition, stagger narrow segments, or delete erroneous dimensions.

Parameters

Parameter Type Requirement Description
adjustments array of object Required List of dimension adjustment commands.
↳ adjustments[].dimension_id integer (Int64) Required Element ID (Int64) of the Dimension to modify.
↳ adjustments[].action string Required Action to perform: ‘move_line’, ‘move_text’, ‘stagger_narrow_segments’, ‘delete’.
↳ adjustments[].line_offset_delta_mm number (float) Optional Offset delta in mm to move the dimension line (+ away from walls, – closer).
↳ adjustments[].segment_index integer (Int64) Optional Target segment index (0-based) for ‘move_text’. Omit if single-segment dimension.
↳ adjustments[].text_offset_mm object Optional Offset values for moving segment text position.
↳ adjustments[].text_offset_mm.along_line_mm number (float) Optional Offset along the dimension line vector in mm.
↳ adjustments[].text_offset_mm.perpendicular_mm number (float) Optional Offset perpendicular to the dimension line in mm.

Example Invocation

{
  "adjustments": [
    {
      "dimension_id": 2049182,
      "action": "move_line",
      "line_offset_delta_mm": 200.0
    }
  ]
}

12. Generative BIM Element Creation

Tools for querying creatable types and batch-creating linear elements (walls, pipes, ducts, conduits, cable trays, beams), polygonal profile elements (floors, ceilings), hosted family instances, and rooms.

TOOL

get_creatable_types

Query available FamilySymbols, WallTypes, FloorTypes, PipeTypes, DuctTypes, and Levels in the active project. Returns placement_type (OneLevelBased, OneLevelBasedHosted, WorkPlaneBased, etc.) and is limited to max_results (default 50) to prevent token overflow.

Parameters

Parameter Type Requirement Description
category string Optional Optional category filter: ‘Walls’, ‘Floors’, ‘Doors’, ‘Windows’, ‘Structural Columns’, ‘Structural Framing’, ‘Pipes’, ‘Ducts’, ‘Cable Trays’, ‘Conduits’, ‘Levels’, ‘SystemTypes’.
search_keyword string Optional Optional case-insensitive substring search in Type Name or Family Name.
max_results integer (Int64) Optional Maximum number of items to return (default: 50, max: 100) to protect token budget.

Example Invocation

{
  "category_name": "Walls",
  "limit": 50
}
TOOL

create_linear_elements

Batch-create linear elements (Walls, Beams, Pipes, Ducts, CableTrays, Conduits, Grids, ModelLines) inside a single Transaction. Supports path_points for multi-segment MEP with auto_connect_fittings: true (elbows), location_line and is_structural for Walls, and silent failure handling.

Parameters

Parameter Type Requirement Description
items array of object Required Array of linear elements to create in a single atomic transaction.
↳ items[].element_type_category string Required Category: ‘Wall’, ‘Beam’, ‘Pipe’, ‘Duct’, ‘CableTray’, ‘Conduit’, ‘Grid’, ‘ModelLine’ (required).
↳ items[].type_id integer (Int64) Optional Optional Type ElementId (Int64). Defaults to project default if omitted.
↳ items[].level_id integer (Int64) Optional Optional Level ElementId (Int64). Defaults to active view’s level if omitted.
↳ items[].start_point object Optional Start coordinate {x, y, z} in unit (e.g. mm).
↳ items[].end_point object Optional End coordinate {x, y, z} in unit (e.g. mm).
↳ items[].path_points array of object Optional Optional array of 3D points [{x, y, z}, …] for multi-segment runs (e.g. MEP routing or poly-wall). Overrides start/end if provided.
↳ items[].unit string Optional Unit for coordinates: ‘mm’ (default), ‘m’, ‘cm’, ‘inch’, ‘ft’.
↳ items[].height_mm number (float) Optional Unconnected height for Wall in mm (default: 3000mm).
↳ items[].location_line string Optional Wall location line: ‘WallCenterline’ (default), ‘CoreCenterline’, ‘FinishFaceExterior’, ‘FinishFaceInterior’, ‘CoreExterior’, ‘CoreInterior’.
↳ items[].is_structural boolean Optional Whether Wall or Beam is structural (default: false).
↳ items[].flipped boolean Optional Whether to flip Wall orientation (default: false).
↳ items[].system_type_id integer (Int64) Optional Optional MEPSystemType ElementId for Pipe or Duct.
↳ items[].diameter_mm number (float) Optional Diameter for Pipe or Round Duct in mm.
↳ items[].width_mm number (float) Optional Width for Rectangular Duct or Cable Tray in mm.
↳ items[].height_mep_mm number (float) Optional Height for Rectangular Duct or Cable Tray in mm.
↳ items[].auto_connect_fittings boolean Optional For MEP with path_points: automatically insert Elbow fittings between consecutive segments (default: true).
↳ items[].parameters object Optional Optional dictionary of parameter names and values to assign after creation.
dry_run boolean Optional If true, simulates the creation and rolls back the Transaction. No changes committed to the model (default: false).

Example Invocation

{
  "dry_run": false,
  "items": [
    {
      "category": "Walls",
      "type_id": 349182,
      "level_id": 1024,
      "start_point": {
        "x": 0.0,
        "y": 0.0,
        "z": 0.0
      },
      "end_point": {
        "x": 6000.0,
        "y": 0.0,
        "z": 0.0
      },
      "height_mm": 3000.0,
      "is_structural": false,
      "location_line": "WallCenterline"
    }
  ]
}
TOOL

create_profile_elements

Batch-create profile/boundary elements (Floors, Ceilings) from closed polygonal boundaries inside a single Transaction. Supports height_offset_mm, is_structural for floors, multi-version .NET wrapping, and silent failure handling.

Parameters

Parameter Type Requirement Description
items array of object Required Array of profile elements to create.
↳ items[].element_type string Required ‘Floor’ or ‘Ceiling’ (required).
↳ items[].type_id integer (Int64) Optional Optional FloorType or CeilingType ElementId (Int64).
↳ items[].level_id integer (Int64) Optional Optional Level ElementId. Defaults to active view’s level.
↳ items[].boundary_points array of object Required Array of 3D points [{x, y, z}, …] defining the closed polygon boundary (at least 3 points required).
↳ items[].unit string Optional Unit for coordinates: ‘mm’ (default), ‘m’, ‘cm’, ‘inch’, ‘ft’.
↳ items[].height_offset_mm number (float) Optional Height offset from level in mm (default: 0).
↳ items[].is_structural boolean Optional Whether floor is structural (default: false).
↳ items[].parameters object Optional Optional dictionary of parameter names and values to assign after creation.
dry_run boolean Optional If true, simulates the creation and rolls back the Transaction. No changes committed to the model (default: false).

Example Invocation

{
  "dry_run": false,
  "items": [
    {
      "category": "Floors",
      "type_id": 482910,
      "level_id": 1024,
      "height_offset_mm": 0.0,
      "is_structural": false,
      "boundary_polygon_mm": [
        {
          "x": 0.0,
          "y": 0.0
        },
        {
          "x": 6000.0,
          "y": 0.0
        },
        {
          "x": 6000.0,
          "y": 5000.0
        },
        {
          "x": 0.0,
          "y": 5000.0
        }
      ]
    }
  ]
}
TOOL

place_family_instances

Batch-place Family Instances (Doors, Windows, Columns, MEP Equipment, Terminals, Fixtures) inside a single Transaction. Discriminates FamilyPlacementType (OneLevelBased, OneLevelBasedHosted, WorkPlaneBased, TwoLevelsBased), snaps hosted items to wall axis, and supports rotation.

Parameters

Parameter Type Requirement Description
items array of object Required Array of family instances to place.
↳ items[].symbol_id integer (Int64) Required FamilySymbol ElementId (Int64) (required).
↳ items[].location object Required Coordinates {x, y, z} in unit (required).
↳ items[].unit string Optional Unit for coordinates: ‘mm’ (default), ‘m’, ‘cm’, ‘inch’, ‘ft’.
↳ items[].level_id integer (Int64) Optional Optional Level ElementId. Defaults to active view’s level.
↳ items[].host_element_id integer (Int64) Optional Optional Host ElementId (Int64). Required for Doors/Windows (Wall host) and hosted fixtures.
↳ items[].rotation_degrees number (float) Optional Optional rotation angle around Z-axis in degrees.
↳ items[].sill_height_mm number (float) Optional Optional sill height or elevation offset in mm (for Windows or Wall-hosted items).
↳ items[].is_structural boolean Optional Whether instance is structural (for Columns) (default: false).
↳ items[].parameters object Optional Optional dictionary of parameter names and values to assign after creation.
dry_run boolean Optional If true, simulates the placement and rolls back the Transaction. No changes committed to the model (default: false).

Example Invocation

{
  "dry_run": false,
  "items": [
    {
      "type_id": 591823,
      "level_id": 1024,
      "location": {
        "x": 3000.0,
        "y": 0.0,
        "z": 0.0
      },
      "host_id": 1048100,
      "rotation_degrees": 0.0
    }
  ]
}
TOOL

create_rooms

Batch-create architectural Rooms and place RoomTags at interior points within enclosed spaces. Includes pre-check for existing rooms (GetRoomAtPoint), mandatory doc.Regenerate() to compute area boundaries, and automatic cleanup (doc.Delete) for unenclosed spaces (Area <= 1e-4) to prevent model corruption.

Parameters

Parameter Type Requirement Description
rooms array of object Required Array of room definitions to create.
↳ rooms[].name string Required Room name, e.g. ‘Living Room’, ‘Phòng khách’, ‘Master Bedroom’ (required).
↳ rooms[].number string Optional Optional room number, e.g. ‘101’, ‘P.01’.
↳ rooms[].point object Required 2D interior point {x, y} or {u, v} within the enclosed space (required).
↳ rooms[].level_id integer (Int64) Optional Optional Level ElementId. Defaults to active view’s level.
↳ rooms[].tag_room boolean Optional Whether to place RoomTag at room center (default: true).
↳ rooms[].unit string Optional Unit for coordinates: ‘mm’ (default), ‘m’, ‘ft’, ‘cm’.
↳ rooms[].coordinate_space string Optional ‘model_mm’ (default) or ‘pixel’ (converts via active CalibrationSession).
↳ rooms[].parameters object Optional Optional dictionary of custom parameters to assign.
level_id integer (Int64) Optional Optional fallback Level ElementId for all rooms.
tag_all boolean Optional Global toggle to place RoomTags for all rooms (default: true).
coordinate_space string Optional Global coordinate space: ‘model_mm’ (default) or ‘pixel’.
dry_run boolean Optional If true, simulates room creation and rolls back the Transaction.

Example Invocation

{
  "level_id": 1024,
  "rooms": [
    {
      "name": "Mechanical Room",
      "number": "M-101",
      "point": {
        "x": 2500.0,
        "y": 2500.0,
        "z": 0.0
      },
      "tag_room": true
    }
  ]
}

13. Drawing Underlays & Pixel Calibration

Tools for importing external PDF/raster drawings into Revit views and calibrating pixel-to-model scale factors using reference coordinates.

TOOL

import_drawing_underlay

Imports an external 2D raster/vector file (PDF, PNG, JPG, BMP) into a Revit view as an image underlay. NOTE: For existing DWG/DXF CAD files already linked/imported in Revit, use ‘list_dwg_underlays’ and CAD-to-BIM tools instead. Places the image at BoxPlacement.BottomLeft to synchronize coordinate systems with the AI Agent, sets DrawLayer to Background, and automatically initializes an in-memory CalibrationSession for pixel-to-model coordinate mapping.

Parameters

Parameter Type Requirement Description
file_path string Required Absolute file path to the PDF, PNG, JPG, or BMP drawing (required).
view_id integer (Int64) Optional Target View ElementId. If omitted, uses the active view.
page_number integer (Int64) Optional Page number for PDF files (1-based, default: 1).
dpi number (float) Optional Resolution DPI for PDF rasterization (default: 300).
origin_x_mm number (float) Optional Bottom-left insertion X in mm (default: 0).
origin_y_mm number (float) Optional Bottom-left insertion Y in mm (default: 0).
scale_ratio number (float) Optional Additional scale multiplier (default: 1.0).
is_background boolean Optional Whether to push underlay to DrawLayer.Background (default: true).
image_width_px number (float) Optional Known pixel width of the image for calibration.
image_height_px number (float) Optional Known pixel height of the image for calibration.

Example Invocation

{
  "file_path": "C:\\Drawings\\Architectural_Plan_L1.png",
  "view_id": 2049182
}
TOOL

calibrate_drawing_scale

Calibrates in-memory pixel-to-model transformation using two reference points (e.g. Grid A-1 and Grid B-1). Computes precise scale factor (mm/pixel) and origin offset in C#, completely eliminating LLM floating-point calculation errors.

Parameters

Parameter Type Requirement Description
image_width_px number (float) Required Total image width in pixels (required).
image_height_px number (float) Required Total image height in pixels (required).
point1 object Required First reference point (e.g. Origin Grid intersection).
↳ point1.u number (float) Required Pixel u coordinate (0 to image_width_px).
↳ point1.v number (float) Required Pixel v coordinate (0 to image_height_px, from top).
↳ point1.real_x_mm number (float) Optional Target Revit X in mm (default: 0).
↳ point1.real_y_mm number (float) Optional Target Revit Y in mm (default: 0).
point2 object Required Second reference point (e.g. Known span along Grid).
↳ point2.u number (float) Required Pixel u coordinate.
↳ point2.v number (float) Required Pixel v coordinate.
↳ point2.real_x_mm number (float) Optional Target Revit X in mm.
↳ point2.real_y_mm number (float) Optional Target Revit Y in mm.
session_id string Optional Optional session identifier (defaults to ‘default’).

Example Invocation

{
  "image_width_px": 3840.0,
  "image_height_px": 2160.0,
  "point1": {
    "pixel_x": 420.0,
    "pixel_y": 680.0,
    "model_x_mm": 0.0,
    "model_y_mm": 0.0
  },
  "point2": {
    "pixel_x": 2840.0,
    "pixel_y": 680.0,
    "model_x_mm": 18000.0,
    "model_y_mm": 0.0
  }
}

14. MEP Connectors & 3D Orthogonal Routing

Tools for inspecting MEP connector coordinates, flow directions, sizes, and domains, and automatically generating orthogonal routed connections with elbow fittings.

TOOL

inspect_mep_connectors

Inspect all MEP connectors (Piping, HVAC, Electrical) on a specified element or the currently selected elements in Revit. Returns connector origin (in mm), direction vector (BasisZ), domain, connection status, profile shape, size, and system type.

Parameters

Parameter Type Requirement Description
element_id integer (Int64) Optional Optional Revit ElementId (Int64). If omitted, inspects all currently selected elements in Revit.
open_only boolean Optional If true, only returns unconnected/open connectors available for routing (default: false).

Example Invocation

{
  "element_id": 1048291,
  "open_only": true
}
TOOL

auto_route_mep_connectors

Connect two MEP elements (Pipes, Ducts, Cable Trays, Conduits) orthogonally with automatic elbow fittings using 3D orthogonal routing. Supports connecting elements pre-selected by the user in Revit or specified via element1_id & element2_id. Implements 6-attempt auto-retry loop with collision avoidance and silent failure preprocessor.

Parameters

Parameter Type Requirement Description
element1_id integer (Int64) Optional Optional Revit ElementId (Int64) of the first MEP element. If omitted, uses active Revit selection.
element2_id integer (Int64) Optional Optional Revit ElementId (Int64) of the second MEP element. If omitted, uses active Revit selection.
connector1_origin object Optional Optional coordinate {x, y, z} in mm to select a specific connector on element 1.
connector2_origin object Optional Optional coordinate {x, y, z} in mm to select a specific connector on element 2.
curve_type_id integer (Int64) Optional Optional PipeType or DuctType ElementId. Inferred automatically from connected elements if omitted.
system_type_id integer (Int64) Optional Optional MEPSystemType ElementId. Inferred automatically from connectors if omitted.
max_attempts integer (Int64) Optional Maximum orthogonal route permutations to attempt (default: 6).
dry_run boolean Optional If true, simulates the routing and rolls back the transaction. (default: false).

Example Invocation

{
  "element1_id": 1048291,
  "element2_id": 1048295,
  "max_attempts": 6,
  "dry_run": false
}

15. CAD / DWG Extraction & Modeling

Tools for scanning visible DWG/DXF links, inspecting layers, extracting CAD curves into in-memory session caches, and generating BIM elements directly from CAD geometry.

TOOL

list_dwg_underlays

Finds all DWG/DXF Link and Import instances already present/visible in the active Plan View (Step 1 of CAD-to-BIM pipeline). For importing external PDF or image files, use ‘import_drawing_underlay’. Filters out hidden imports and evaluates Visibility/Graphics (VG) layer visibility. Returns file names, Element IDs, Link status, base levels, and layer visibility counts so the user/agent can choose which file to process.

Parameters

Parameter Type Requirement Description
view_id integer (Int64) Optional Optional Plan View ElementId (Int64). Defaults to the currently active view.

Example Invocation

{}
TOOL

inspect_dwg_underlay

Inspects the CAD Layers and geometric breakdown of a selected DWG/DXF instance. Traverses nested GeometryInstances (CAD Blocks) recursively with Transform accumulation, handles Layer ‘0’ inheritance, processes both Curves (Line/Arc) and PolyLines, and identifies which layers are visible in the view’s VG overrides with heuristic suggestions for Walls, Columns, Floors, and Stairs.

Parameters

Parameter Type Requirement Description
instance_id integer (Int64) Optional ElementId (Int64) of the DWG ImportInstance to inspect (required if multiple files exist).
file_name string Optional Optional DWG file name to match if instance_id is omitted.
view_id integer (Int64) Optional Optional Plan View ElementId. Defaults to active view.

Example Invocation

{
  "instance_id": 3058291
}
TOOL

extract_dwg_geometry

Extracts, rectifies, and groups 2D CAD geometry (Walls, Columns, Floors, Stairs) from a DWG/DXF instance into an In-Memory C# Cache. Applies 1D Overlap Interval Projection for double-line walls, rectangle/circle detection for columns, closed-loop extraction for floors, and riser clustering for stairs. Returns a compact statistical summary grouped by wall thickness and column size with a unique ‘extraction_id’ (zero LLM token bottlenecks).

Parameters

Parameter Type Requirement Description
instance_id integer (Int64) Required ElementId (Int64) of the DWG ImportInstance (required).
view_id integer (Int64) Optional Optional Plan View ElementId. Defaults to active view.
wall_layers array of string Optional Array of CAD layer names to extract as Walls. If omitted, uses auto-detected wall layers.
column_layers array of string Optional Array of CAD layer names to extract as Columns. If omitted, uses auto-detected column layers.
floor_layers array of string Optional Array of CAD layer names to extract as Floor boundaries. If omitted, uses auto-detected floor layers.
stair_layers array of string Optional Array of CAD layer names to extract as Stairs. If omitted, uses auto-detected stair layers.
min_wall_thickness_mm number (float) Optional Minimum wall thickness in mm for parallel pair detection (default: 50.0).
max_wall_thickness_mm number (float) Optional Maximum wall thickness in mm for parallel pair detection (default: 400.0).
min_wall_overlap_mm number (float) Optional Minimum 1D overlap interval in mm between parallel wall lines (default: 100.0).
single_line_wall_fallback boolean Optional Whether to extract unpaired single lines on wall layers as walls with default thickness (default: false).
default_wall_thickness_mm number (float) Optional Default wall thickness in mm for single-line walls (default: 200.0).
include_details boolean Optional Whether to include detailed coordinate lists in the response (default: false, recommended false to save tokens).

Example Invocation

{
  "instance_id": 3058291,
  "selected_layers": [
    "A-WALL",
    "S-COLS"
  ],
  "simplify_tolerance_mm": 5.0
}
TOOL

get_dwg_cached_session

Retrieves the statistical summary of a previously extracted DWG geometry session from in-memory cache.

Parameters

Parameter Type Requirement Description
extraction_id string Required The unique extraction_id returned by extract_dwg_geometry.

Example Invocation

{}
TOOL

generate_bim_from_dwg_cache

Generates BIM elements (Walls, Columns, Floors, Stairs) directly from an In-Memory DWG Extraction Cache session. Takes extraction_id, Level IDs, and Type mappings, creates elements inside a unified TransactionGroup with silent failure preprocessor, and supports dry_run simulation rollback (zero LLM token bottlenecks, zero coordinate round-tripping).

Parameters

Parameter Type Requirement Description
extraction_id string Required The unique extraction_id returned by extract_dwg_geometry (required).
elements_to_generate array of string Optional Array of element categories to generate: ‘Wall’, ‘Column’, ‘Floor’, ‘Stair’. Defaults to all available in cache.
base_level_id integer (Int64) Optional Optional Base Level ElementId (Int64). Defaults to the DWG extraction base level.
top_level_id integer (Int64) Optional Optional Top Level ElementId (Int64) for Walls, Columns, and Stairs.
unconnected_wall_height_mm number (float) Optional Unconnected Wall height in mm if top_level_id is omitted (default: 3000.0).
wall_type_mapping object Optional Optional dictionary mapping wall thickness in mm (e.g. ‘220’, ‘110’) or ‘default’ to WallType ElementId (Int64).
column_type_mapping object Optional Optional dictionary mapping column group key (e.g. ‘Rectangular 220x400mm’, ‘Circular D400mm’) or ‘default’ to FamilySymbol ElementId (Int64).
floor_type_id integer (Int64) Optional Optional FloorType ElementId (Int64). Defaults to project default if omitted.
location_line string Optional Wall location line: ‘WallCenterline’ (default), ‘CoreCenterline’, ‘FinishFaceExterior’, ‘FinishFaceInterior’.
is_structural boolean Optional Whether generated walls, columns, and floors are structural (default: false).
dry_run boolean Optional If true, simulates the creation inside a TransactionGroup and rolls back. No changes committed to the model (default: false).

Example Invocation

{
  "level_id": 1024,
  "dry_run": false,
  "element_mappings": [
    {
      "cad_layer": "A-WALL",
      "bim_category": "Walls",
      "type_id": 349182,
      "height_mm": 3200.0
    }
  ]
}

MLabs Revit MCP

Version: v1.2.0 • Last Updated: Nov 3, 2026