{ "version": "1.0.0", "global_settings": { "plugin_directory": ".", "lisp_directory": ".", "hot_reload": true }, "tools": [ { "name": "zoom_window_normalized", "description": "归一化框选放大工具。当你发现当前截图中某些目标太小、细节模糊时,估算该目标在画面中的归一化坐标,调用此工具将该区域全屏放大以看清细节。", "inputSchema": { "type": "object", "properties": { "x1": { "type": "number", "description": "左上角 X 坐标,取值 0.0 到 1.0" }, "y1": { "type": "number", "description": "左上角 Y 坐标,取值 0.0 到 1.0" }, "x2": { "type": "number", "description": "右下角 X 坐标,取值 0.0 到 1.0" }, "y2": { "type": "number", "description": "右下角 Y 坐标,取值 0.0 到 1.0" } }, "required": [ "x1", "y1", "x2", "y2" ] }, "backend": { "type": "lisp_inline", "script_template": "(progn (setq vc (getvar \"VIEWCTR\") vs (getvar \"VIEWSIZE\") ss (getvar \"SCREENSIZE\") w (* vs (/ (car ss) (cadr ss))) x_tl (- (car vc) (/ w 2.0)) y_tl (+ (cadr vc) (/ vs 2.0)) pt1 (list (+ x_tl (* {x1} w)) (- y_tl (* {y1} vs))) pt2 (list (+ x_tl (* {x2} w)) (- y_tl (* {y2} vs)))) (command \"_.ZOOM\" \"_W\" \"_non\" pt1 \"_non\" pt2))" } }, { "name": "zoom_extents", "description": "全局缩放。将CAD视口重置为显示所有图元。当你迷失方向、放大过度或者需要寻找新目标时使用。", "inputSchema": { "type": "object", "properties": {} }, "backend": { "type": "lisp_inline", "script_template": "(command \"_.ZOOM\" \"_E\")" } }, { "name": "get_viewport_screenshot", "description": "获取 AutoCAD 当前工作视口的实时截图。当需要检查图纸细节、判断是否需要缩放,或需要通过视觉确认图元位置时调用。", "inputSchema": { "type": "object", "properties": {}, "required": [] }, "backend": { "type": "c++_dll", "dll_name": "cad_mcp_plugins.dll", "factory_function": "CreateViewportScreenshotTool" } }, { "name": "get_drawing_info", "description": "获取当前图纸的元数据:文件名、单位、布局数量、各空间实体总数。审查流程的第一步。", "inputSchema": { "type": "object", "properties": {} }, "backend": { "type": "c++_dll", "dll_name": "cad_mcp_plugins.dll", "factory_function": "CreateGetDrawingInfoTool" } }, { "name": "get_layers", "description": "获取图层清单:开关、冻结、锁定、颜色、线型,可选统计每图层实体数(用于查找空图层/规范检查)。", "inputSchema": { "type": "object", "properties": { "name_filter": { "type": "string", "description": "图层名通配符,如 \"WALL*\",省略则全部" }, "include_empty": { "type": "boolean", "description": "统计实体数时是否包含空图层,默认 false" }, "count_entities": { "type": "boolean", "description": "是否统计每图层实体数,默认 false" } } }, "backend": { "type": "c++_dll", "dll_name": "cad_mcp_plugins.dll", "factory_function": "CreateGetLayersTool" } }, { "name": "get_layouts", "description": "获取布局清单:模型空间与各图纸空间布局、实体数、布局内视口。", "inputSchema": { "type": "object", "properties": {} }, "backend": { "type": "c++_dll", "dll_name": "cad_mcp_plugins.dll", "factory_function": "CreateGetLayoutsTool" } }, { "name": "query_entities", "description": "按图层/类型/范围查询图元摘要,分页返回(total/returned/offset/items)。实体 ID 为 handle。", "inputSchema": { "type": "object", "properties": { "space": { "type": "string", "description": "\"Model\" 或布局名,默认 Model" }, "layer_filter": { "type": "string", "description": "图层通配符" }, "type_filter": { "type": "array", "items": { "type": "string" }, "description": "类型白名单,如 [\"LINE\",\"LWPOLYLINE\"]" }, "window": { "type": "object", "properties": { "min_x": { "type": "number" }, "min_y": { "type": "number" }, "max_x": { "type": "number" }, "max_y": { "type": "number" } } }, "limit": { "type": "integer", "description": "单次最大返回,默认 200,上限 1000" }, "offset": { "type": "integer", "description": "分页偏移,默认 0" } } }, "backend": { "type": "c++_dll", "dll_name": "cad_mcp_plugins.dll", "factory_function": "CreateQueryEntitiesTool" } }, { "name": "get_text_content", "description": "提取 TEXT/MTEXT/ATTRIB 文字:内容、位置、字高、旋转、图层、包围盒。用于查错字、空文字、重叠、字高异常。", "inputSchema": { "type": "object", "properties": { "space": { "type": "string" }, "layer_filter": { "type": "string" }, "content_filter": { "type": "string", "description": "内容子串过滤(可选)" }, "window": { "type": "object", "properties": { "min_x": { "type": "number" }, "min_y": { "type": "number" }, "max_x": { "type": "number" }, "max_y": { "type": "number" } } }, "limit": { "type": "integer" }, "offset": { "type": "integer" } } }, "backend": { "type": "c++_dll", "dll_name": "cad_mcp_plugins.dll", "factory_function": "CreateGetTextContentTool" } }, { "name": "get_dimensions", "description": "提取标注:类型、测量值、文本覆盖、标注样式、图层。用于查漏标/标注异常。", "inputSchema": { "type": "object", "properties": { "space": { "type": "string" }, "layer_filter": { "type": "string" }, "window": { "type": "object", "properties": { "min_x": { "type": "number" }, "min_y": { "type": "number" }, "max_x": { "type": "number" }, "max_y": { "type": "number" } } }, "limit": { "type": "integer" }, "offset": { "type": "integer" } } }, "backend": { "type": "c++_dll", "dll_name": "cad_mcp_plugins.dll", "factory_function": "CreateGetDimensionsTool" } }, { "name": "get_block_references", "description": "提取块参照:块名、插入点、旋转、缩放、图层及全部属性(tag/value)。用于查属性缺失/不符。", "inputSchema": { "type": "object", "properties": { "space": { "type": "string" }, "layer_filter": { "type": "string" }, "block_name_filter": { "type": "string", "description": "块名通配符" }, "window": { "type": "object", "properties": { "min_x": { "type": "number" }, "min_y": { "type": "number" }, "max_x": { "type": "number" }, "max_y": { "type": "number" } } }, "limit": { "type": "integer" }, "offset": { "type": "integer" } } }, "backend": { "type": "c++_dll", "dll_name": "cad_mcp_plugins.dll", "factory_function": "CreateGetBlockReferencesTool" } }, { "name": "get_polylines_info", "description": "提取多段线信息:闭合性、面积、长度、顶点数、包围盒。用于查未闭合轮廓。", "inputSchema": { "type": "object", "properties": { "space": { "type": "string" }, "layer_filter": { "type": "string" }, "window": { "type": "object", "properties": { "min_x": { "type": "number" }, "min_y": { "type": "number" }, "max_x": { "type": "number" }, "max_y": { "type": "number" } } }, "limit": { "type": "integer" }, "offset": { "type": "integer" } } }, "backend": { "type": "c++_dll", "dll_name": "cad_mcp_plugins.dll", "factory_function": "CreateGetPolylinesInfoTool" } }, { "name": "get_entity_detail", "description": "按 handle 获取单个实体的完整属性。用于对某疑点下钻查看。", "inputSchema": { "type": "object", "properties": { "handle": { "type": "string", "description": "实体句柄" } }, "required": [ "handle" ] }, "backend": { "type": "c++_dll", "dll_name": "cad_mcp_plugins.dll", "factory_function": "CreateGetEntityDetailTool" } }, { "name": "detect_drawing_frames", "description": "识别图纸中的图框(块参照/闭合矩形多段线/直线组三种形态),推算图幅(A0-A4及加长)与方向,按位置排序。用于按图框逐张审查或分图。", "inputSchema": { "type": "object", "properties": { "space": { "type": "string" }, "layer_filter": { "type": "string", "description": "限定图框所在图层通配符" }, "block_name_filter": { "type": "string", "description": "图框块名通配符;指定后仅按块名匹配,信任该块" }, "detect_line_loops": { "type": "boolean", "description": "是否识别四条直线围成的图框,默认 false" }, "min_side": { "type": "number", "description": "最小短边过滤(图纸单位)" }, "ratio_tol": { "type": "number", "description": "长宽比容差,默认 0.06" }, "axis_tol": { "type": "number", "description": "轴对齐判定容差,默认 1.0" }, "min_confidence": { "type": "number", "description": "最低置信度过滤 0~1,默认 0" }, "window": { "type": "object", "properties": { "min_x": { "type": "number" }, "min_y": { "type": "number" }, "max_x": { "type": "number" }, "max_y": { "type": "number" } } } } }, "backend": { "type": "c++_dll", "dll_name": "cad_mcp_plugins.dll", "factory_function": "CreateDetectDrawingFramesTool" } }, { "name": "find_duplicate_entities", "description": "查找几何重复/重叠实体,按几何签名分桶,返回重复组(handles)。", "inputSchema": { "type": "object", "properties": { "space": { "type": "string" }, "layer_filter": { "type": "string" }, "type_filter": { "type": "array", "items": { "type": "string" } }, "tolerance": { "type": "number", "description": "几何容差,默认 0.001" }, "limit": { "type": "integer", "description": "最大重复组数,默认 200" } } }, "backend": { "type": "c++_dll", "dll_name": "cad_mcp_plugins.dll", "factory_function": "CreateFindDuplicateEntitiesTool" } }, { "name": "find_zero_length", "description": "查找零长度/退化实体(长度小于容差的 LINE/ARC/LWPOLYLINE)。", "inputSchema": { "type": "object", "properties": { "space": { "type": "string" }, "layer_filter": { "type": "string" }, "tolerance": { "type": "number", "description": "长度容差,默认 0.001" }, "limit": { "type": "integer" }, "offset": { "type": "integer" } } }, "backend": { "type": "c++_dll", "dll_name": "cad_mcp_plugins.dll", "factory_function": "CreateFindZeroLengthTool" } }, { "name": "zoom_to_entity", "description": "缩放到指定 handle(或 handle 列表)实体的范围,四周留 5% 边距。配合截图确认。", "inputSchema": { "type": "object", "properties": { "handle": { "type": "string" }, "handles": { "type": "array", "items": { "type": "string" } } } }, "backend": { "type": "c++_dll", "dll_name": "cad_mcp_plugins.dll", "factory_function": "CreateZoomToEntityTool" } }, { "name": "zoom_to_window", "description": "缩放到指定 WCS 范围(逐图框审查用,对直线组图框尤其实用)。范围可给 min_x/min_y/max_x/max_y 或 window 对象。", "inputSchema": { "type": "object", "properties": { "min_x": { "type": "number" }, "min_y": { "type": "number" }, "max_x": { "type": "number" }, "max_y": { "type": "number" }, "window": { "type": "object", "properties": { "min_x": { "type": "number" }, "min_y": { "type": "number" }, "max_x": { "type": "number" }, "max_y": { "type": "number" } } }, "margin": { "type": "number", "description": "四周留边比例,默认 0.02" } } }, "backend": { "type": "c++_dll", "dll_name": "cad_mcp_plugins.dll", "factory_function": "CreateZoomToWindowTool" } }, { "name": "highlight_entities", "description": "按 handle 列表临时高亮实体(改色,默认红色);restore=true 时复位为 ByLayer。", "inputSchema": { "type": "object", "properties": { "handle": { "type": "string" }, "handles": { "type": "array", "items": { "type": "string" } }, "color": { "type": "integer", "description": "ACI 颜色索引,默认 1(红)" }, "restore": { "type": "boolean", "description": "是否复位为 ByLayer" } } }, "backend": { "type": "c++_dll", "dll_name": "cad_mcp_plugins.dll", "factory_function": "CreateHighlightEntitiesTool" } } ] }