Skip to main content
Glama
davidharutyunyan

Archicad MCP Connector

Create a GDL library part

create_library_part

Create custom GDL library parts in the embedded library from scripts and parameters to add objects missing from the standard library, returning name, GUID, and index for placement.

Instructions

Creates a custom GDL library part (object, lamp, door, window, skylight, label, zone stamp) in the project's EMBEDDED library from GDL scripts and a parameter list, then returns its {libraryPart: {name, guid, index}} so create_objects / create_lamps can place it. Use it for anything the standard library lacks (custom furniture, built-ins, fixtures, signage, parametric equipment). overwrite: true replaces an existing embedded part of the same name (placed instances keep their link and update). Defaults: type 'Object' with subtype ModelElement; a ZZYZX (height) Length parameter is added for objects/lamps; when script2D is omitted for objects/lamps it is 'PROJECT2 3, 270, 2' (plan symbol = top view of the 3D model). Verify with get_library_part_scripts, then place it and look at it (3D view / get_element_details); GDL errors show up as missing geometry.

GDL QUICK REFERENCE (units: meters, angles in DEGREES):

  • Local system: origin = insertion point, X along A (width), Y along B (depth), Z up, ZZYZX = height. Every parameter is a variable in all scripts; A, B (and ZZYZX for objects) always exist.

  • masterScript runs before the 2D, 3D and parameter scripts: compute shared variables there. One statement per line; '!' starts a comment; strings in "..." or '...'.

  • 3D transformations (a stack): ADDX dx / ADDY dy / ADDZ dz / ADD dx, dy, dz; ROTX a / ROTY a / ROTZ a; MULX f / MUL fx, fy, fz; DEL n (undo the last n), DEL TOP (undo all).

  • 3D bodies at the current origin: BLOCK a, b, c (box along +X +Y +Z); PRISM_ n, h, x1, y1, s1, ..., xn, yn, sn (vertical extrusion of a polygon; s = 15 for visible edges); CPRISM_ topMat, botMat, sideMat, n, h, x1, y1, s1, ...; CYLIND h, r (along Z); SPHERE r; ELLIPS h, r; CONE h, r1, r2, 90, 90; REVOLVE n, alpha, mask, x1, y1, s1, ... (profile in the XY plane revolved around X); EXTRUDE n, dx, dy, dz, mask, x1, y1, s1, ...; TUBE; RULED; SLAB_.

  • Attributes: MATERIAL m (surface name, index or a Surface parameter) before the bodies; PEN p; RESOL n (segments of curved surfaces); HOTSPOT x, y, z (3D editing point).

  • 2D script (plan symbol): PROJECT2 3, 270, 2 (top view of the 3D model), or draw: LINE2 x1, y1, x2, y2; RECT2 x1, y1, x2, y2; POLY2_ n, frameFill, x1, y1, s1, ... (frameFill 1 = contour, 2 = fill, 4 = close; 7 = all); CIRCLE2 x, y, r; ARC2 x, y, r, a1, a2; FILL f before a filled POLY2_; HOTSPOT2 x, y; TEXT2 x, y, "text"; ADD2 dx, dy / ROT2 a / MUL2 fx, fy / DEL n.

  • parameterScript: VALUES "len" 0.6, 0.8, 1.2 | VALUES "len" RANGE [0.3, 2.4] | VALUES "style" "Modern", "Classic"; LOCK "param"; HIDEPARAMETER "param"; PARAMETERS param = expression (store a computed value).

  • Flow: IF c THEN ... ELSE ... ENDIF; FOR i = 1 TO n ... NEXT i; WHILE c DO ... ENDWHILE; GOSUB "sub" ... END ... "sub": ... RETURN. Operators + - * / ^ MOD = <> < > <= >= AND OR NOT; functions SIN COS TAN ATN (degrees), SQR (square root), ABS, MIN, MAX, INT, FRA, STR, PI.

  • Example: table with parameters [{name:'topThk', type:'Length', value:0.04}, {name:'legW', type:'Length', value:0.05}, {name:'mat', type:'Surface', value:}], a: 1.6, b: 0.8, height: 0.75, script3D: MATERIAL mat ADDZ ZZYZX - topThk BLOCK A, B, topThk DEL 1 FOR i = 0 TO 1 FOR j = 0 TO 1 ADD i * (A - legW), j * (B - legW), 0 BLOCK legW, legW, ZZYZX - topThk DEL 1 NEXT j NEXT i (script2D omitted = PROJECT2 3, 270, 2)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
aNoDefault A (X size) in m (default 1)
bNoDefault B (Y size) in m (default 1)
nameYesLibrary part name (becomes the .gsm file name; no / \ : * ? " < > |). Must be unique in the loaded libraries
typeNoLibrary part type (default Object, or implied by subtype)
authorNoAuthor / copyright
folderNoSub-folder in the embedded library (default 'Claude Objects'; '' = root)
heightNoDefault ZZYZX (height) in m for the automatic height parameter (default 1)
commentNoDescription shown in the library browser
fixSizeNoSize cannot be stretched (default false)
scriptsNoGDL scripts (plain text, newline separated)
subtypeNoParent subtype: a keyword (GeneralGDLObject, ModelElement, BuildingElement, Furnishing, Beds, Structure, Column, Beam, Slab, Wall, Roof, Stair, Railing, Ramp, Covering, Footing, Plant, People, Animal, Traffic, TransportElement, StreetFurniture, SportField, DistributionElement, ElectricalElement, FlowTerminal, FlowEquipment, SolarPVPanels, DrawingSymbol, DocumentationElement, Marker, PropertyObjects, Light, WindowWall, CornerWindow, DoorWall, WallOpening, WallEnd, Skylight, Label, ZoneStamp) or a template library part name/{guid} from get_library_part_subtypes. Default by type: Object → ModelElement, Lamp → Light, Window → WindowWall, Door → DoorWall, Skylight, Label, Zone → ZoneStamp
keywordsNoSearch keywords
templateNoCan be used as a subtype of other parts (default false)
overwriteNoReplace an existing embedded library part with the same name (default false)
placeableNoCan be placed (default true; false = macro for CALL)
parametersNoParameter list in dialog order (A, B are implicit — use a / b)
autoHotspotsNoAutomatic bounding-box hotspots (default true; set false when the 2D script places HOTSPOT2s)
addHeightParameterNoAdd a ZZYZX Length parameter when not declared (default true for Object/Lamp)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.6/5.0
Behavior5/5

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

With annotations covering the safety profile, the description still adds real behavioral detail: overwrite:true replaces an existing embedded part of the same name and existing placed instances keep their link and update, which is a non-obvious mutation consequence. It also discloses defaults (type Object / subtype ModelElement, automatic ZZYZX parameter, default script2D), the return shape, and the failure mode ('GDL errors show up as missing geometry').

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

Conciseness4/5

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

The prose is front-loaded (purpose and return first, then usage, defaults, verification, and reference) and every line is information-dense. The embedded GDL quick reference is large, but given there is no output schema and no separate reference resource, it earns its place; the only cost is that the description is long for a tool blurb.

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

Completeness5/5

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

For an 18-parameter, deeply nested, write-type tool with no output schema, the description covers purpose, defaults, overwrite semantics, return value, verification workflow, and the GDL syntax needed to populate the script fields. An agent has everything required to invoke it correctly and to validate the result.

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?

Schema description coverage is already 100%, so the schema carries most parameter meaning. The description nevertheless adds semantics the schema does not: the automatic ZZYZX height parameter behavior, the default 2D script for objects/lamps, subtype defaults by type, and a full GDL quick reference that makes the scripts/parameters fields usable. This exceeds the baseline 3 but does not re-explain every individual field.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The opening sentence names a specific verb and resource ('Creates a custom GDL library part ... in the project's EMBEDDED library from GDL scripts and a parameter list') and even states the return shape and the downstream consumers (create_objects / create_lamps). This clearly separates it from sibling placement tools like create_objects, create_lamps, and change_library_part.

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?

'Use it for anything the standard library lacks (custom furniture, built-ins, fixtures, signage, parametric equipment)' gives a concrete when-to-use condition, and the overwrite:true note plus the 'Verify with get_library_part_scripts, then place it' workflow adds practical context. It stops short of an explicit when-not-to-use / alternative (e.g., modify an existing part instead), so it is a strong 4 rather than a 5.

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

Deploy Server

Other Tools