{"at":"2026-11-23T01:10:54.805Z","dir":"sent","era":"server_discover","message":{"id":1,"jsonrpc":"2.0","method":"server/discover","params":{"_meta":{"io.modelcontextprotocol/clientCapabilities":{},"io.modelcontextprotocol/clientInfo":{"name":"didrun-lab","version":"0.1.0"},"io.modelcontextprotocol/protocolVersion":"2026-07-28"}}}}
{"at":"2026-11-23T01:10:55.761Z","dir":"received","era":"server_discover","message":{"error":{"code":-32601,"message":"Method not found: server/discover"},"id":1,"jsonrpc":"2.0"}}
{"at":"2026-11-23T01:10:55.862Z","dir":"sent","era":"initialize","message":{"id":1,"jsonrpc":"2.0","method":"initialize","params":{"capabilities":{},"clientInfo":{"name":"didrun-lab","version":"0.1.0"},"protocolVersion":"2025-11-25"}}}
{"at":"2026-11-23T01:10:56.827Z","dir":"received","era":"initialize","message":{"id":1,"jsonrpc":"2.0","result":{"capabilities":{"tools":{}},"instructions":"DRAWINGS: every tool that works on a model takes `drawing`. The first call of a model passes \"new\"; its answer names the drawing's id (\"d-…\"). Pass that id in every further call of this conversation about that model: run_script, tree, snapshot, save, view and all the others. A drawing belongs to the conversation that opened it: no other conversation reaches it, and none can reach yours. A second, unrelated model is a second drawing (\"new\" again). A subagent works on your model only with its id: hand it over in the task. Drawings live as long as this MCP; to keep a model beyond that, save it (OFB keeps its features).\n\nSIGN-IN: the ClassCAD MCP needs a free classcad.ch account, once per machine. Right after installing or setting up this MCP, and whenever the user asks to sign in, call `login` at once — do not leave the sign-in for later. When a tool answers \"Sign-in required\", do the same. `login` opens the sign-in page in the user's browser; ALSO show the user the link it returns, as a clickable link on its own line, then call `login` again — it waits and returns as soon as they have signed in. Docs tools work without a sign-in.\n\nAPP: every drawing has a live CAD app (Buerligons), docked into its engine. It shows every change as it happens, and the user can work in it too — turn the model, select, measure, edit sketches and features, export. With the first model it opens by itself in the user's default browser, where there is one: the result of that script ends with \"App: <link>\" and says whether it did. Tell the user ONCE that the app is there, with the link on its own line. Do NOT repeat the link unasked in later answers: it is said once per drawing. When the user asks where the model is, wants to see it again or asks for the link, call `view`: it knows whether they still have the app open, brings it up again if not, and returns the link. ONE LINK: where the share service is reachable, the app's link is a share link (https://…): the same link you open is the one the user can send to somebody else, or open on another device — say so ONCE, when you tell them about the app, and that everyone who has it is let into the session. A link on 127.0.0.1 instead means the share service was not reachable: then the app works on this machine only, which you need not explain. If the share link does not load in the browser or stays without the model, do not retry it: call `view` with local: true and open the link it returns — the app on this machine, which needs no service. `share` with stop: true takes the share link back. The user and you work on the SAME model: what they change in the app is in the tree you read next, so read it again (api.tree(), `tree`) instead of trusting ids from before their turn. When the user points instead of naming (\"this face\", \"the selected edges\", \"here\"), call `get_selection`; `set_selection` highlights something for them.\n\nClassCAD MCP. run_script is the ONLY way to execute API calls (JavaScript against the live CAD session; state persists between scripts — follow-up scripts ATTACH via api.tree(), never part.create twice). A NEW, unrelated model: open a new drawing for it (drawing: \"new\") — a drawing holds one model and outlives a request, so part.create is refused in one that holds a model already. `clear` empties the drawing you name, to start over in it. PLAN FIRST, THEN FETCH ONCE: decide the whole build, pick every method you will need from the index below, then request ALL their docs in ONE docs([...]) call, recipes first — include \"DATA\" whenever a script reads api.tree()/api.graphic() (\"STRUCTURE\" and \"GRAPHICS\" are the depth: history, sketches, assemblies, world transforms; the graphic payload). A docs response is size-capped: keys listed under \"NOT included yet\" at its top must be requested in a follow-up call before building. Pick the build recipe by the INPUT, not the verb: reproducing DIMENSIONED geometry — a technical drawing, a fetched or attached drawing image, a spec with values, whatever the part type — is \"recipes/constrained-sketching\" territory (dimension checklist → constraints + dimensions; the solver lays out the sketch). A hardcoded coordinate layout is dead geometry: it passes shape checks and cannot regenerate. Every assembly and every model of several parts — new, from STEP or vendor parts, or a cleanup — follows \"recipes/clean-construction\": one template per distinct shape, one feature per operation, design values not coordinates, no scaffolding or placement-only mates, never measure an instance; its audit gates delivery. \"recipes/parametric-part\" adds expressions + regeneration across features; \"recipes/assembly-parameters\" covers values shared by several parts of an assembly (assemblies host no expressions — parameter part, refresh, constraints that follow parameters); \"recipes/pattern-then-subtract\" covers N cutouts around an axis; \"recipes/direct-modeling-eif\" is for one-shot solids WITHOUT a dimensioned reference — never for drawing reproduction; \"recipes/buerli-app\" turns a model into the user's own web app. ALWAYS include \"recipes/verification\": every build ends in verification, so it belongs in the SAME bulk fetch as the build docs. Recipes encode the composed workflow WITH its pitfalls — imitating them is faster and safer than composing from method docs. After that, build in a FEW substantial staged scripts — not one method per round. Verify with numbers (calculateMassProperties) and snapshot renders. REFERENCE IMAGES: \"recipes/verification\" Part I governs from FIRST image exposure, before extracting dimensions or planning — fetch it and follow it to the letter: reference record first (handedness resolved by coincidence questions; one question per fresh reader where the host offers isolated readers; undecidables ASKED of the user, or DECLARED with the deciding channel when no user is reachable; record written down and frozen), then build, then the final gate — the A|B pair-sheet mirror check, UNCONDITIONAL for every image-referenced build and judged against the reference IMAGE, never against your own record. In-task handedness readings are measurably unreliable even when they feel certain; the readers, the record and the gate exist because of that.\n\nENGINES: the MCP runs on a ClassCAD worker (Drogon server) or on its OWN local WASM engine (no server, no browser); either way apps can dock into its session, and with an app's invite link it joins the session of that app. An invite link/URL decides by itself; otherwise use_session(engine=\"auto\"|\"drogon\"|\"wasm\") — auto = worker if reachable else local WASM; a worker that comes up later takes over while the local drawing is still empty (a modeled session stays put). \"use WASM / local / offline\" → engine \"wasm\"; \"my Drogon/ClassCAD server\" → \"drogon\". session_info shows what is in use.\n\nOWN APP: when the user wants their own app, website or configurator around the model (the session's scripts or a saved OFB), call `account` FIRST — the plan decides where the app may run (localhost on every plan; public domains only as registered on the account) and it hands over the public token for the page — then follow docs([\"recipes/buerli-app\"]).\n\nDAEMON: every connection of a host to this MCP is a session in ONE shared daemon process per machine (127.0.0.1:9097), with the drawings its conversations opened; it exits a minute after its last session. Rebuilt MCP/renderer code only runs in a new daemon — an idle one is replaced automatically. Shell commands: `node \"/opt/server/node_modules/@classcad/mcp/dist/server.js\" status` (pid, build, sessions); `node \"/opt/server/node_modules/@classcad/mcp/dist/server.js\" stop` (stops it only when no session is active); `node \"/opt/server/node_modules/@classcad/mcp/dist/server.js\" stop --force` (terminates it NOW — every connected host, this one included, loses its drawings: ask the user first. Tabs reconnect to a fresh daemon on their next tool call; tabs started before this MCP version need a host restart). Never kill daemon processes by hand.\n\nMethod Index (v1) — every method, one line. Pick directly from here; use docs([...]) for exact parameters and trap notes, list_methods to filter. Never conclude an operation does not exist without checking this index:\n\nv1.assembly.assemblyTemplate: Creates a new assembly and adds it as template to the product container.\nv1.assembly.calculateMassProperties: Calculates the center of gravity (cog) and the volume of the given object.\nv1.assembly.circularPattern: Creates a new circular pattern constraint.\nv1.assembly.convertToTemplate: Converts the current root assembly into an assembly template and creates a new root asse…\nv1.assembly.create: Creates a new root assembly.\nv1.assembly.createUncommitedObject: Attention: This method should only be used, if the intention is very clear.\nv1.assembly.cylindrical: Creates a new cylindrical constraint.\nv1.assembly.deleteConstraint: Deletes constraints/ relations from assemblies.\nv1.assembly.deleteInstance: Deletes instances from root assembly, other instances or assembly templates.\nv1.assembly.deleteTemplate: Deletes a part or assembly template.\nv1.assembly.exportNode: Exports a node from the assembly tree or a template from containers.\nv1.assembly.fastened: Creates a new fastened constraint.\nv1.assembly.fastenedOrigin: Creates a new fastened origin constraint.\nv1.assembly.finishMovingUnderConstraints: Finishes moving the constrained objects.\nv1.assembly.from: Creates an assembly from a json defined assembly or an ecxml definition.\nv1.assembly.gear: Creates a new gear relation.\nv1.assembly.getAssemblyTemplate: Returns the assembly template with given name from assembly container.\nv1.assembly.getCircularPattern: Returns the circular pattern constraint of given reference with specified name.\nv1.assembly.getCylindrical: Returns the cylindrical constraint of given reference with specified name.\nv1.assembly.getFastened: Returns the fastened constraint of given reference with specified name.\nv1.assembly.getFastenedOrigin: Returns the fastened origin constraint of given reference with specified name.\nv1.assembly.getGear: Returns the gear relation of given reference with specified name.\nv1.assembly.getGroup: Returns the group constraint of given reference with specified name.\nv1.assembly.getInstance: Returns a single, mutliple or all instances of an owner, depending on whether a name is…\nv1.assembly.getLinearPattern: Returns the linear pattern constraint of given reference with specified name.\nv1.assembly.getParallel: Returns the parallel constraint of given reference with specified name.\nv1.assembly.getPartTemplate: Returns the part template with given name from part container.\nv1.assembly.getPlanar: Returns the planar constraint of given reference with specified name.\nv1.assembly.getProduct: Returns the product id from a given instance.\nv1.assembly.getRevolute: Returns the revolute constraint of given reference with specified name.\nv1.assembly.getSlider: Returns the slider constraint of given reference with specified name.\nv1.assembly.getSpherical: Returns the spherical constraint of given reference with specified name.\nv1.assembly.getWorkGeometry: Returns the id of the work geometry object with the given name from the given assembly o…\nv1.assembly.group: Creates a new group constraint.\nv1.assembly.instance: Creates instances of products and adds them to root assembly, assembly instance or assem…\nv1.assembly.linearPattern: Creates a new linear pattern constraint.\nv1.assembly.loadProduct: Loads a product from file, data or url.\nv1.assembly.moveUnderConstraints: Attempts to move constrained objects.\nv1.assembly.parallel: Creates a new parallel constraint.\nv1.assembly.partTemplate: Creates a new part and adds it as template to the product container.\nv1.assembly.planar: Creates a new planar constraint.\nv1.assembly.revolute: Creates a new revolute constraint.\nv1.assembly.setCurrentInstance: Sets the given instance or root assembly as the current.\nv1.assembly.setCurrentProduct: Sets the current product.\nv1.assembly.setIdent: Sets a string identifier for an existing object\nv1.assembly.slider: Creates a new slider constraint.\nv1.assembly.spherical: Creates a new spherical constraint.\nv1.assembly.startMovingUnderConstraints: Prepares to move constrained objects.\nv1.assembly.transformInstance: Transforms instances by the given transformation.\nv1.assembly.transformInstanceTo: Transforms instances by the given transformation.\nv1.assembly.update3DConstraintValue: Updates multiple limited values of constraints\nv1.assembly.updateCircularPattern: Updates an existing circular pattern constraint.\nv1.assembly.updateCylindrical: Updates an existing cylindrical constraint.\nv1.assembly.updateFastened: Updates an existing fastened constraint.\nv1.assembly.updateFastenedOrigin: Updates an existing fastened origin constraint.\nv1.assembly.updateGear: Updates an existing gear relation.\nv1.assembly.updateGroup: Updates an existing group constraint.\nv1.assembly.updateLinearPattern: Updates an existing linear pattern constraint.\nv1.assembly.updateParallel: Updates an existing parallel constraint.\nv1.assembly.updatePlanar: Updates an existing planar constraint.\nv1.assembly.updateRevolute: Updates a revolute constraint.\nv1.assembly.updateSlider: Updates an existing slider constraint.\nv1.assembly.updateSpherical: Updates an existing spherical constraint.\nv1.common.batch: Runs the given api calls in a sequence.\nv1.common.clear: Deletes all objects in the current drawing\nv1.common.clearUserData: Clears all entries from user data of given object\nv1.common.evaluateExpression: Evaluates an expression.\nv1.common.getAppVersion: Returns the app version\nv1.common.getClassFileVersion: Returns the class file version\nv1.common.getDatabaseSettings: Returns the current general settings from the database\nv1.common.getFacetingParameters: Returns the faceting parameters used to tessellate surfaces and curves.\nv1.common.getUserData: Returns the value from the user data map at given key.\nv1.common.getUserDataKeys: Returns all the keys of user data map of given object\nv1.common.load: Reads drawing from ClassCAD- or SolidFile, drawing must be cleared or doClear set to TRUE.\nv1.common.recalc: Recalculates and updates the whole drawing with all its objects\nv1.common.removeUserData: Removes the user data entry identified by given key\nv1.common.requestVisualisation: Requests the visualisation of the entities/cad entities from the classcad server\nv1.common.save: Stores the current model.\nv1.common.setAppearance: Sets the appearance on the target, which is here defined by an id which is the feature a…\nv1.common.setDatabaseSettings: Sets the current and initial general settings on the database.\nv1.common.setFacetingParameters: Sets the faceting parameters of current drawing.\nv1.common.setObjectCoordSystem: Calls \"SetObjectCoordSystem\" on object or sets object coord system if function does not…\nv1.common.setObjectName: Calls \"SetObjectName\" on object or sets object name if function does not exist\nv1.common.setUserData: Sets custom user data by key and value on given object.\nv1.common.transformObjectWithMatrix: Transforms an object with the given matrix.\nv1.curve.advancedPolyline: Creates an advanced polyline definition using an array of point-line definitions.\nv1.curve.arcBy3Points: Creates one or multiple arcs defined by start-, end- and mid point.\nv1.curve.arcByCenter: Creates one or multiple arcs defined by start-, end- and center point.\nv1.curve.arcByCenterRadAngle: Creates one or multiple arcs defined by center, radius and angle\nv1.curve.bezierCurve: Creates one or multiple BezierCurves of degree n (number of points -1)\nv1.curve.circle: Creates one or multiple circles in a shape container\nv1.curve.cleanShape: Cleans the provided shapes, which means that the curves of the shapes will be deleted, b…\nv1.curve.deleteShape: Deletes shapes\nv1.curve.ellipse: Creates one or multiple ellipse curves\nv1.curve.ellipticArc: Creates one or multiple elliptic arc curves\nv1.curve.interpolationCurve: Creates an interpolation curve through given array of points\nv1.curve.intersection2d: Creates an intersection between two shapes\nv1.curve.line: Creates one or multiple lines in a shape container\nv1.curve.polyline2d: Creates a single or multiple entity array of lines and arcs, given a polyline definition…\nv1.curve.rotateShape: Rotates the given shape by the given rotation vector.\nv1.curve.scaleShape: Scales the given shape with a factor\nv1.curve.shape: Creates a shape in a container\nv1.curve.subtraction2d: Creates an subtraction between two shapes\nv1.curve.transformShape: Transforms the given shape with a 4x4 tranformation matrix.\nv1.curve.translateShape: Translates the given shape by the given vector.\nv1.curve.union2d: Creates an union between two shapes\nv1.drawing2d.centerView: This method centers all given views to origin, depending on each view's boundary box.\nv1.drawing2d.deleteDimension: Deletes one or multiple dimensions of the 2d view\nv1.drawing2d.dimension: Creates one or multiple dimensions in the product.\nv1.drawing2d.exportDXF: Exports all the views from given product into dxf.\nv1.drawing2d.exportSVG: Exports all the views from given product into svg.\nv1.drawing2d.getBoundaryBoxFromView: This method returns min and max point for each given view.\nv1.drawing2d.isDXFAvailable: Returns true if DXF functionality is available, false if not.\nv1.drawing2d.isSVGAvailable: Returns true if SVG functionality is available, false if not.\nv1.drawing2d.placeView: Places each view relatively to its current position in xy-plane\nv1.drawing2d.updateDimensionPosition: Updates the position of the dimension text.\nv1.drawing2d.view: Creates the defined 2d views of the given product (solids) in xy-plane and returns the i…\nv1.part.boolean: Creates a boolean feature.\nv1.part.box: Creates or updates a box feature.\nv1.part.calculateMassProperties: Calculates the center of gravity (cog) and the volume of the given object.\nv1.part.chamfer: Creates a chamfer feature.\nv1.part.circularPattern: Creates a circular pattern feature.\nv1.part.closeFeature: Moves GhostRollbackBar back to RollbackBar, sets relevant entities' visibility.\nv1.part.compositeCurve: Creates a composite curve feature.\nv1.part.cone: Creates a cone feature.\nv1.part.create: Clears the drawing and creates a new part\nv1.part.createUncommitedObject: Attention: This method should only be used, if the intention is very clear.\nv1.part.cylinder: Creates a cylinder feature.\nv1.part.deleteExpression: Deletes expressions in different products\nv1.part.deleteFeature: Deletes existing features, work geometries and sketches\nv1.part.entityDeletion: Creates a entity deletion feature.\nv1.part.entityInjection: Creates a new entity injection.\nv1.part.expression: Creates expressions in different products\nv1.part.extrusion: Creates an extrusion feature.\nv1.part.fillet: Creates a fillet feature.\nv1.part.getBrepGeometryByIndex: Returns a brep element within the given brep container by its index.\nv1.part.getBrepGeometryIndex: Returns an index of a brep element within its brep container.\nv1.part.getExpression: Returns the value and the expression\nv1.part.getFeature: Returns the id of the feature with the given name from the given part.\nv1.part.getGeometryIds: Returns the geometry (brep element like line, arc, plane,...) which best fits the given…\nv1.part.getGeometryPositions: Returns the positions which uniquely identifying the geometries (brep element like line,…\nv1.part.getSketch: Returns the id of the sketch with the given name from the given part.\nv1.part.getSketchRegion: Returns the id of the sketch region with the given name from the given part or instance.\nv1.part.getWorkGeometry: Returns the id of the work geometry object with the given name from the given part or in…\nv1.part.importFeature: Creates an import feature.\nv1.part.linearPattern: Creates a linear pattern feature.\nv1.part.linkWithExpression: Connects an expression with a dimensional constraint in a sketch or a parameter in a fea…\nv1.part.mirror: Creates a mirror feature.\nv1.part.openFeature: Moves GhostRollbackBar to the position before passed feature, sets relevant entities' vi…\nv1.part.operationMoveBefore: Moves the rollback bar to the position right before the provided feature (backwards or f…\nv1.part.operationMoveToEnd: Moves the rollback bar to the latest feature and sets the entities of the current featur…\nv1.part.renameExpression: Renames expressions in different products\nv1.part.revolve: Creates or updates a revolve feature.\nv1.part.rotation: Creates a rotation feature.\nv1.part.setAppearance: Sets the appearance on the target, which is here defined by an id which is the feature a…\nv1.part.sketch: Creates a new sketch and places it optionally on a face or work plane - if planeId is a…\nv1.part.slice: Creates a slice feature.\nv1.part.sliceBySheet: Creates a slice by sheet feature.\nv1.part.sphere: Creates a sphere feature.\nv1.part.transformationByCSys: Creates a transformation by csys feature.\nv1.part.translation: Creates a translation feature.\nv1.part.twist: Creates a twist feature.\nv1.part.unlinkExpression: Unlinks expression from dimensional constraints in sketcher or parameter in feature\nv1.part.updateBoolean: Updates a boolean feature.\nv1.part.updateBox: Updates a box feature.\nv1.part.updateChamfer: Updates a chamfer feature.\nv1.part.updateCircularPattern: Updates a circular pattern feature.\nv1.part.updateCompositeCurve: Updates a composite curve feature.\nv1.part.updateCone: Updates a cone feature.\nv1.part.updateCylinder: Updates a cylinder feature.\nv1.part.updateEntityDeletion: Updates an existing entity deletion feature.\nv1.part.updateExpression: Updates an existing expressions in different products\nv1.part.updateExtrusion: Updates an extrusion feature.\nv1.part.updateFillet: Updates a fillet feature.\nv1.part.updateImportFeature: Updates an import feature.\nv1.part.updateLinearPattern: Updates a linear pattern feature.\nv1.part.updateMirror: Updates a mirror feature.\nv1.part.updateRevolve: Updates a revolve feature.\nv1.part.updateRotation: Updates a rotation feature.\nv1.part.updateSlice: Updates a slice feature.\nv1.part.updateSliceBySheet: Updates a slice by sheet feature.\nv1.part.updateSphere: Updates a sphere feature.\nv1.part.updateTransformationByCSys: Updates a transformation by csys feature.\nv1.part.updateTranslation: Updates a translation feature.\nv1.part.updateTwist: Updates a twist feature.\nv1.part.updateWorkAxis: Updates a work axis feature.\nv1.part.updateWorkCSys: Updates a work coordinate system feature.\nv1.part.updateWorkPlane: Updates a work plane feature.\nv1.part.updateWorkPoint: Updates a work point feature.\nv1.part.workAxis: Creates a work axis feature.\nv1.part.workCSys: Creates a work coordinate system feature.\nv1.part.workPlane: Creates a work plane feature.\nv1.part.workPoint: Creates a work point feature.\nv1.sketch.arcBy3Points: Creates one or multiple arcs by 3 points in the sketch.\nv1.sketch.arcByCenter: Creates one or multiple arcs by center in the sketch.\nv1.sketch.changeReferenceGeometry: Re-links \"Use\"-Geometry in sketch - the same geometry will be connected to another refer…\nv1.sketch.circle: Creates one or multiple circles in the sketch\nv1.sketch.circularPattern: Patterns a rigidset (or single object) in circular arrange/order\nv1.sketch.constraint: Creates one or multiple constraints in the sketch\nv1.sketch.copyFrom: Copies the sketch geometry from one sketch to another\nv1.sketch.copyGeometry: Copies sketch geometry\nv1.sketch.create: Creates a new sketch and places it optionally on a face or work plane - if planeId is a…\nv1.sketch.deleteObject: Deletes dimensions, constraints, sketch geometry, sketch region or rigid sets from sketch\nv1.sketch.deleteSketch: Deletes existing sketches\nv1.sketch.dimension: Creates one or multiple dimensional constraints in the sketch\nv1.sketch.fillet: Creates a fillet in place of a point and its connecting two lines\nv1.sketch.generateAutoConstraints: Automatically generates constraints whenever it makes sense and doesn't add up redundancy\nv1.sketch.geometry: Creates one or multiple sketch geometry in the sketch\nv1.sketch.getDiagnosticsInfo: Get the info about unsatisfied constraints of the sketch\nv1.sketch.getGeometry: Get all the sketch geometry from a sketch, sketch region or rigid set\nv1.sketch.getGlobalState: Get the global state of the sketch\nv1.sketch.getObjectInfo: Get the detailed info about the object\nv1.sketch.getObjectsLists: Get the lists of ids of the sketch objects\nv1.sketch.getPoints: Get the specific point ids of lines, arcs or circles\nv1.sketch.getPositions: Get the specific positions of points, lines, arcs or circles\nv1.sketch.getSketchRegion: Returns the id of the sketch region with the given name which belongs to the given sketc…\nv1.sketch.getTopologyInfo: Get the topology info of the sketch\nv1.sketch.line: Creates one or multiple lines in the sketch\nv1.sketch.linearPattern: Patterns a rigidset (or single object) in linear/rectangular arrange/order.\nv1.sketch.loadFrom: Loads an ofb file by filename, data or url and copies the sketch geometry from loaded sk…\nv1.sketch.mirrorPattern: Patterns a rigidset (or single object) in mirror arrange/order\nv1.sketch.moveGeometry: Moves the given sketch geometry by translation vector\nv1.sketch.point: Creates one or multiple points in the sketch\nv1.sketch.postTrim: Merges the split curves back after trimming, finalizing the trim operation.\nv1.sketch.preTrim: Splits curves at their mutual intersection points, preparing them for trimming.\nv1.sketch.rectangle: Creates a rectangle formed by two positions\nv1.sketch.referenceGeometry: Creates new \"Use\"-Geometry in sketch.\nv1.sketch.rigidSet: Creates a rigid set from given sketch geometry in the sketch\nv1.sketch.setReferences: Creates and sets the plane, axis and origin reference of the sketch\nv1.sketch.setWorkPlane: Sets workplane for the sketch\nv1.sketch.sketchRegion: Creates a sketch region for a given sketch from sketch geometry\nv1.sketch.splitAllCurves: (deprecated) Use preTrim instead.\nv1.sketch.splitCurve: Splits curves at specified parameterized positions.\nv1.sketch.splitCurves: (deprecated) Use splitCurve instead (singular).\nv1.sketch.splitCurvesMergeBack: (deprecated) Use postTrim from trimming workflow instead.\nv1.sketch.trim: Removes curve segments produced by preTrim.\nv1.sketch.trimCurves: (deprecated) Use trim from trimming workflow instead.\nv1.sketch.undoFillet: Deletes an existing fillet by removing the arc and its constraints and connect lines again\nv1.sketch.unlinkReferenceGeometry: Unlinks \"Use\"-Geometry in sketch - sketch geometry still exists, but it is not connected…\nv1.sketch.updateDimension: Updates the dimension of sketch geometry and recalculates the sketch\nv1.sketch.updateDimensionPosition: Updates the position of the dimension text\nv1.sketch.updateGeometry: Updates the sketch geometry\nv1.sketch.updateSketchRegion: Updates sketch regions with new sketch geometry\nv1.solid.box: Creates a box\nv1.solid.cone: Creates a cone\nv1.solid.copy: Creates a copy of the given solid\nv1.solid.cylinder: Creates a cylinder\nv1.solid.deleteSolid: Deletes the given solids or all solids if no solids are provided.\nv1.solid.extrusion: Creates an extrusion by extruding a shape or sketch geometry\nv1.solid.fillet: Creates a fillet at the given edges.\nv1.solid.intersection: Creates an intersection between solids\nv1.solid.merge: Creates an merge between solids.\nv1.solid.mirror: Mirrors the given solid at defined plane\nv1.solid.offset: Creates an offset solid of the given solid Note: This functionality is a quite difficult…\nv1.solid.revolve: Creates a revolve by revolving a polyline\nv1.solid.rotation: Rotates the given solid by the given rotation vector.\nv1.solid.scale: Scales the given solid with a factor.\nv1.solid.section: The given solid is sectioned at the given plane.\nv1.solid.slice: Cuts the given solid at defined plane.\nv1.solid.sphere: Creates a sphere\nv1.solid.subtraction: Creates a subtraction between solids\nv1.solid.translation: Translates the given solid by the given vector.\nv1.solid.union: Creates a union between solids\nv1.solid.useSolid: This method allows you to work with solids from other features.\n\nDocument Index — the data contract (DATA, STRUCTURE, GRAPHICS: what api.tree()/api.graphic() return), recipes (composed workflows) and guides (cross-cutting behavior), key — title. Fetch with docs([...]); list_methods({ search }) also ranks these by topic:\n\nDATA — the tree & graphic contract for scripts\nGRAPHICS — the graphic payload (protocol version 11)\nPLANS — what a ClassCAD plan enables\nSTRUCTURE — the model tree\nrecipes/assembly-parameters — Shared parameters across the parts of an assembly\nrecipes/buerli-app — Recipe — your own app around the model (buerli + React)\nrecipes/clean-construction — Clean construction — one template per shape, one feature per operation (parts and assembly models without clutter, duplication or feature creep)\nrecipes/constrained-sketching — Sketching Guide — Reproducing Technical Drawings in ClassCAD\nrecipes/direct-modeling-eif — Direct modeling with solid.\\* inside an Entity Injection Feature (EIF)\nrecipes/parametric-part — A truly parametric part (expressions + constrained sketches)\nrecipes/pattern-then-subtract — Pattern a cutting tool, then subtract (holes, teeth, slots on a circle)\nrecipes/verification — Recipe — verification (mandatory for every build)\nassembly/generic — Assembly: Template vs Instance Paradigm\nassembly/movingUnderConstraints — assembly.startMovingUnderConstraints / moveUnderConstraints / finishMovingUnderConstraints\ncommon/encoding-pipeline — Encoding/Compression Pipeline\ncommon/expression-syntax — Expression Syntax Reference\ncommon/faceting-concepts — Faceting Concepts — chordHeightTol, angleTol, Quality vs Performance\ncommon/format-comparison — Format Comparison — OFB vs STP vs STL vs SCG vs IWP vs DXF\ncommon/generic — Protocol Envelope\ncommon/userData — common.setUserData / getUserData / removeUserData / clearUserData / getUserDataKeys\npart/brep-access-pattern — Brep Geometry Access Pattern\npart/expression-workflow — Expression Workflow (End-to-End)\npart/feature-vs-direct — Feature Primitives vs Direct Solids\npart/id-hierarchy — Entity Injection ID Hierarchy\npart/rollback-bars — RollbackBar vs GhostRollbackBar\nsolid/curves-parameter — The `curves` Parameter (solid.extrusion & solid.revolve)\nsolid/generic — Common Solid Parameters: rotation, translation, rotateFirst\nsolid/target-tools-pattern — The target/tools/keepTools Pattern","protocolVersion":"2025-11-25","serverInfo":{"name":"classcad","version":"0.6.2"}}}}
{"at":"2026-11-23T01:10:56.827Z","dir":"sent","era":"initialize","message":{"jsonrpc":"2.0","method":"notifications/initialized"}}
{"at":"2026-11-23T01:10:56.827Z","dir":"sent","era":"initialize","message":{"id":2,"jsonrpc":"2.0","method":"tools/list","params":{}}}
{"at":"2026-11-23T01:10:56.842Z","dir":"received","era":"initialize","message":{"id":2,"jsonrpc":"2.0","result":{"tools":[{"description":"Sign this machine in to ClassCAD (a free classcad.ch account; Google, GitHub or email). Call it RIGHT AFTER installing the MCP. Not signed in: the first call opens the sign-in page in the user's browser and returns its link — show it to the user as a clickable link too — and the next call WAITS (up to ~50 s per call) until they have signed in in the browser, then returns their account. Call again while it reports \"still waiting\". Already signed in: returns the account at once. logout: true signs the machine out.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","properties":{"logout":{"description":"Sign this machine out instead.","type":"boolean"}},"type":"object"},"name":"login","title":"Sign in to ClassCAD"},{"description":"The signed-in classcad.ch account: its plan (and until when), whether it allows commercial use, which exports, and WHERE A WEB APP built with ClassCAD may run under it — localhost always (any port), public https domains only as registered on the account (from the plan that has them) — plus the public access token (ccpk_…) that goes into the app's page, or where to make one. Call it FIRST when the user wants their own app, website, configurator or deployment around a model; then follow docs([\"recipes/buerli-app\"]). Read-only: tokens and domains are made on the account page.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","properties":{},"type":"object"},"name":"account","title":"ClassCAD account and plan"},{"description":"The live CAD app of this session (Buerligons), docked into the same engine: returns its link and says how to bring it up. Where the session is shared from the start the link is its share link (it works from anywhere); local: true returns the link that works on this machine only instead — for when the share link does not load. The app shows every change as it happens, and the user can work in it — turn and zoom, select, measure, edit sketches and features, export STEP or STL. Call it when the user asks to see, turn or edit the model, or asks for the link. If the user already has it open, nothing is opened. Otherwise it is opened in the user's default browser — or, when your host has a browser pane of its own, you are told to open the link there. open: false only returns the link; open: true opens the user's default browser whatever the host.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","properties":{"drawing":{"description":"The drawing this call works on. \"new\" opens a new, empty drawing, and the answer names its id; from then on pass that id (e.g. \"d-k3v9q2xa\") in every call of this conversation about that model. A drawing belongs to the conversation that opened it: no other conversation can see or change it.","type":"string"},"local":{"description":"Return the link of the app on this machine (127.0.0.1), which needs no share service: use it when the share link does not load.","type":"boolean"},"open":{"description":"true: open the user's default browser now. false: only return the link. Default: bring it up where it belongs, unless the user already has it open.","type":"boolean"}},"required":["drawing"],"type":"object"},"name":"view","title":"Open the app"},{"description":"A link to this session's app that works from ANYWHERE: for another person, or for the user on another device (the link `view` returns works on this machine only). Whoever opens it is in this session like the user at the app — they see the model live as you build it, and can turn, select and edit it. Call it when the user asks to share, send or show the model to somebody, or to open it somewhere else. Not on your own: the link lets EVERYONE who has it into the session, so it is a secret between the user and whom they send it to — hand it to the user, as a clickable link on its own line, and put it nowhere else. The session stays on this machine; guests reach it through the ClassCAD share relay, which passes the data on and keeps none of it. The link works until the session ends or sharing is stopped. When the share service cannot be reached, nothing fails: you are told so, the app keeps working on this machine, and the session is shared as soon as the service is back. stop: true takes it back: it stops working and whoever joined with it is disconnected. Sharing again afterwards gives a new link.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","properties":{"drawing":{"description":"The drawing this call works on. \"new\" opens a new, empty drawing, and the answer names its id; from then on pass that id (e.g. \"d-k3v9q2xa\") in every call of this conversation about that model. A drawing belongs to the conversation that opened it: no other conversation can see or change it.","type":"string"},"stop":{"description":"Stop sharing: the link stops working and its guests are disconnected.","type":"boolean"}},"required":["drawing"],"type":"object"},"name":"share","title":"Share the session"},{"description":"What the user has selected in the app docked into this session: faces, edges and vertices of a body, or objects of the model tree (sketch entities, dimensions, features). Call it when the user points at something instead of naming it (\"this face\", \"the selected edges\", \"here\"). Each item has `kind` (face | edge | vertex | object) and `objectId` — the tree object: the picked object itself, or the solid a picked face, edge or vertex belongs to (`object` names its class). Geometry also has `graphicId`, the id API calls take for that face, edge or vertex (e.g. v1.sketch.create({ planeId })), its `type` (plane, cylinder, line, arc, …), `containerId` and `prodRefId`. A selection keeps the ids it was made with: after a feature rebuilds the body, its `containerId` and `objectId` name the old, consumed body (faces and edges the feature did not touch keep their `graphicId`; a recalc renumbers them all). Read the selection right before you use it.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","properties":{"drawing":{"description":"The drawing this call works on. \"new\" opens a new, empty drawing, and the answer names its id; from then on pass that id (e.g. \"d-k3v9q2xa\") in every call of this conversation about that model. A drawing belongs to the conversation that opened it: no other conversation can see or change it.","type":"string"}},"required":["drawing"],"type":"object"},"name":"get_selection","title":"What the user selected"},{"description":"Selects things in the app docked into this session, so the user sees what you mean: faces, edges or vertices by their `graphicId` (from getGeometryIds, pick results or get_selection), tree objects by their `objectId`. The app highlights them. Returns what is selected there afterwards. Geometry ids must be current ones (see get_selection); pass `prodRefId` from a previous get_selection when the part is an instance in an assembly. An empty `items` clears the selection.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","properties":{"drawing":{"description":"The drawing this call works on. \"new\" opens a new, empty drawing, and the answer names its id; from then on pass that id (e.g. \"d-k3v9q2xa\") in every call of this conversation about that model. A drawing belongs to the conversation that opened it: no other conversation can see or change it.","type":"string"},"items":{"description":"What to select.","items":{"properties":{"containerId":{"description":"The body's current graphic container (the part's `solids`). Pass it after a rebuild: without it the app takes the first container holding the graphicId, which can be the old, consumed body's.","type":"number"},"graphicId":{"description":"A face, edge or vertex: its element id.","type":"number"},"objectId":{"description":"A tree object (sketch entity, dimension, feature) — or, with graphicId, the solid that owns the element.","type":"number"},"prodRefId":{"description":"The assembly instance, when the part is one (from get_selection).","type":"number"}},"type":"object"},"type":"array"},"replace":{"description":"Replace the current selection (default) or add to it (false).","type":"boolean"}},"required":["drawing","items"],"type":"object"},"name":"set_selection","title":"Select something for the user"},{"description":"Return ClassCAD MCP session status: the drawing's id, the link of the app docked into this session (app) or of the read-only 3D view (viewer), the link the session is shared with others under (shared; null while it is not), who else is in the session (peers), sign-in (auth), transport (ws = ClassCAD worker, wasm = the MCP's own local engine), engine policy, whether a local WASM engine is available, WS URL, current session id, the invite this session joined with (shareToken), connection state, package version. DAEMON: every connection of a host to this MCP is a session in ONE shared daemon process per machine (127.0.0.1:9097), with the drawings its conversations opened; it exits a minute after its last session. Rebuilt MCP/renderer code only runs in a new daemon — an idle one is replaced automatically. Shell commands: `node \"/opt/server/node_modules/@classcad/mcp/dist/server.js\" status` (pid, build, sessions); `node \"/opt/server/node_modules/@classcad/mcp/dist/server.js\" stop` (stops it only when no session is active); `node \"/opt/server/node_modules/@classcad/mcp/dist/server.js\" stop --force` (terminates it NOW — every connected host, this one included, loses its drawings: ask the user first. Tabs reconnect to a fresh daemon on their next tool call; tabs started before this MCP version need a host restart). Never kill daemon processes by hand.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","properties":{"drawing":{"description":"The drawing this call works on. \"new\" opens a new, empty drawing, and the answer names its id; from then on pass that id (e.g. \"d-k3v9q2xa\") in every call of this conversation about that model. A drawing belongs to the conversation that opened it: no other conversation can see or change it.","type":"string"}},"type":"object"},"name":"session_info","title":"Session info"},{"description":"Make this the FIRST call of a drawing (drawing: \"new\") when the user names a session or hands you a session/token URL — a drawing opens its engine link lazily, so its first tool call decides which session it is. Modes: (1) sessionId — attaches to a named ClassCAD session (ClassCAD-Session-Id header) on the configured worker; empty/omitted = fresh worker-assigned session. (2) url — a ws(s):// URL from a multi-client server, typically carrying an invite token (wss://host/?invite=…); connected VERBATIM. (3) an http(s):// APP SHARE LINK from a buerli app's Session Management (…?invite=…): the MCP joins the app's session as a guest, wherever its engine runs — on a ClassCAD server (the token is applied to the configured worker URL) or in the app's own page (WASM; the app must stay open: on this machine, or anywhere when it shares on the ClassCAD share relay, as buerligons.io does). Without a url the MCP runs its own session — and the user's app docks into THAT with the link `view` returns. (4) engine — WHICH ENGINE runs that own session: \"drogon\" = the configured ClassCAD worker (server), \"wasm\" = the MCP's OWN local engine (the published WASM build hosted in this process, no server and no browser needed; requires a configured key), \"auto\" (default) = the worker if reachable, otherwise the local engine. Use \"drogon\" when the user says to connect to their (Drogon/ClassCAD) server, \"wasm\" when they say WASM/local/offline; a token or URL always decides by itself. Reconnecting clears cached structure/graphic state — the next tool call repopulates it.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","properties":{"drawing":{"description":"The drawing this call works on. \"new\" opens a new, empty drawing, and the answer names its id; from then on pass that id (e.g. \"d-k3v9q2xa\") in every call of this conversation about that model. A drawing belongs to the conversation that opened it: no other conversation can see or change it.","type":"string"},"engine":{"description":"Engine for the MCP's own session when no url is given: auto (worker, else local WASM), drogon (the ClassCAD worker only), wasm (the local engine only). Sticks for the session until changed.","enum":["auto","drogon","wasm"],"type":"string"},"sessionId":{"description":"Target session id (named-session model, worker only). Empty string or omitted = no header (worker-assigned session).","type":"string"},"url":{"description":"ws(s):// URL to connect to VERBATIM — e.g. a multi-client token/invite URL (wss://host/?invite=…). An http(s):// app share link with ?invite= is accepted too: the invite token is extracted and applied to the configured worker URL. Takes precedence over sessionId.","type":"string"}},"required":["drawing"],"type":"object"},"name":"use_session","title":"Switch session"},{"description":"Empty the drawing (v1.common.clear), to start over in it: a drawing persists between requests, part.create refuses a second root, and anything built on the old part would carry its geometry along. For a new, unrelated model next to this one, open a new drawing instead (drawing: \"new\"). Not needed for changes to the current model. The graphic and renders are empty afterwards too — no reconnect needed.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","properties":{"drawing":{"description":"The drawing this call works on. \"new\" opens a new, empty drawing, and the answer names its id; from then on pass that id (e.g. \"d-k3v9q2xa\") in every call of this conversation about that model. A drawing belongs to the conversation that opened it: no other conversation can see or change it.","type":"string"},"keepIds":{"description":"Object IDs to preserve. Omit to wipe everything.","items":{"type":["string","number"]},"type":"array"}},"required":["drawing"],"type":"object"},"name":"clear","title":"Clear drawing"},{"description":"Write the current drawing to a file, or return it as base64. Formats: STP (STEP, exact geometry), STL (triangles), GLB (binary glTF: triangles with colours, for 3D viewers and the web), OFB (ClassCAD's own format: the model with its features, to open again in ClassCAD or Buerligons), JSON. With `path` the file is written to disk and only its path and size come back — the way to hand the user a model (give them the path); without it the content is returned base64-encoded, which is large. The user can also save the model themselves from what `view` opens.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","properties":{"analytic":{"description":"STP only: write planes, cylinders, cones, spheres and tori as such instead of as B-spline surfaces. Other CAD systems read such a file faster and recognise its holes and flats.","type":"boolean"},"drawing":{"description":"The drawing this call works on. \"new\" opens a new, empty drawing, and the answer names its id; from then on pass that id (e.g. \"d-k3v9q2xa\") in every call of this conversation about that model. A drawing belongs to the conversation that opened it: no other conversation can see or change it.","type":"string"},"format":{"description":"Output format.","enum":["STP","STL","GLB","OFB","JSON"],"type":"string"},"path":{"description":"Absolute file path to write, e.g. /Users/me/Desktop/flange.stp (folders are created). Omit to get the content back as base64.","type":"string"}},"required":["drawing","format"],"type":"object"},"name":"save","title":"Save drawing"},{"description":"Load a drawing, replacing the current one: from a file on disk (`path`) or from base64-encoded content. Formats: STP (STEP), STL, OFB, JSON. Prefer `path`: the file is read here and never passes through the conversation, which is the only practical way for a model file of real size. Give exactly one of `path` and `content`.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","properties":{"content":{"description":"Base64-encoded payload, when there is no file.","type":"string"},"drawing":{"description":"The drawing this call works on. \"new\" opens a new, empty drawing, and the answer names its id; from then on pass that id (e.g. \"d-k3v9q2xa\") in every call of this conversation about that model. A drawing belongs to the conversation that opened it: no other conversation can see or change it.","type":"string"},"format":{"description":"Input format.","enum":["OFB","STP","STL","JSON"],"type":"string"},"path":{"description":"Absolute path of the file to load, e.g. /Users/me/parts/bracket.step.","type":"string"}},"required":["drawing","format"],"type":"object"},"name":"load","title":"Load drawing"},{"description":"Save the WHOLE drawing state under a label (in-memory, server-side — cheap and instant). Use BEFORE risky sequences (large booleans, trims, experiments): if the attempt goes wrong, restore({label}) brings the drawing back exactly instead of delete-archaeology. Re-using a label overwrites it; at most 5 checkpoints are kept (oldest dropped). Checkpoints die with the server process and with a use_session switch.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","properties":{"drawing":{"description":"The drawing this call works on. \"new\" opens a new, empty drawing, and the answer names its id; from then on pass that id (e.g. \"d-k3v9q2xa\") in every call of this conversation about that model. A drawing belongs to the conversation that opened it: no other conversation can see or change it.","type":"string"},"label":{"description":"Checkpoint name, e.g. \"before-boolean\". Default \"checkpoint\".","type":"string"}},"required":["drawing"],"type":"object"},"name":"checkpoint","title":"Checkpoint drawing"},{"description":"Replace the drawing with a previously checkpointed state (clear + reload). Without a label, the MOST RECENT checkpoint is restored. All ids from after the checkpoint are stale afterwards — re-read them (tree/find) before further operations.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","properties":{"drawing":{"description":"The drawing this call works on. \"new\" opens a new, empty drawing, and the answer names its id; from then on pass that id (e.g. \"d-k3v9q2xa\") in every call of this conversation about that model. A drawing belongs to the conversation that opened it: no other conversation can see or change it.","type":"string"},"label":{"description":"Checkpoint name. Default: the most recently created one.","type":"string"}},"required":["drawing"],"type":"object"},"name":"restore","title":"Restore checkpoint"},{"description":"Return the cached drawing structure tree. Pass refresh=true to force a fresh server fetch first.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","properties":{"drawing":{"description":"The drawing this call works on. \"new\" opens a new, empty drawing, and the answer names its id; from then on pass that id (e.g. \"d-k3v9q2xa\") in every call of this conversation about that model. A drawing belongs to the conversation that opened it: no other conversation can see or change it.","type":"string"},"refresh":{"description":"Force a server round-trip before reading the cache.","type":"boolean"}},"required":["drawing"],"type":"object"},"name":"tree","title":"Structure tree"},{"description":"Search the cached structure tree by class and/or name substring. Returns slim records (id, class, name, parent).","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","properties":{"drawing":{"description":"The drawing this call works on. \"new\" opens a new, empty drawing, and the answer names its id; from then on pass that id (e.g. \"d-k3v9q2xa\") in every call of this conversation about that model. A drawing belongs to the conversation that opened it: no other conversation can see or change it.","type":"string"},"name":{"description":"Match nodes whose name contains this substring (case-insensitive).","type":"string"},"refresh":{"type":"boolean"},"type":{"description":"Match nodes whose class === type (e.g. \"CC_Part\", \"CC_Box\").","type":"string"}},"required":["drawing"],"type":"object"},"name":"find","title":"Find nodes"},{"description":"Return the full record for a single tree node by ID, including members and children.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","properties":{"drawing":{"description":"The drawing this call works on. \"new\" opens a new, empty drawing, and the answer names its id; from then on pass that id (e.g. \"d-k3v9q2xa\") in every call of this conversation about that model. A drawing belongs to the conversation that opened it: no other conversation can see or change it.","type":"string"},"id":{"description":"Node ID.","type":["string","number"]},"refresh":{"type":"boolean"}},"required":["drawing","id"],"type":"object"},"name":"inspect","title":"Inspect node"},{"description":"Search/list the v1.<domain>.<method> surface. `search` as a string: one BM25-ranked list over method name + summary (whole words), CAD synonyms expanded (split→slice, hole→bore, round→fillet, …). `search` as an ARRAY with ONE CONCEPT PER ENTRY (e.g. [\"expression\", \"box\", \"fastened constraint\", \"mass properties\"]): one group per entry, each ranked on its own, so every concept gets its own top matches (a group note flags entries that are likely workflows, not methods). PLUS `docs`: the recipes/guides whose title, headings or text match (e.g. \"shared parameters assembly\" → recipes/assembly-parameters) — search by what you want to build, then fetch those docs. Without `search`: the full method listing plus `documents` (every recipe and guide, key — title). withSummaries=false returns bare names (token-cheap). A no-hit result does NOT mean the operation is missing — browse the domain instead.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","properties":{"domain":{"description":"Restrict to one domain.","enum":["assembly","common","curve","drawing2d","part","sketch","solid"],"type":"string"},"limit":{"description":"Max ranked results: total for a string search (default 25), per group for an array (default 8).","maximum":300,"minimum":1,"type":"integer"},"search":{"anyOf":[{"type":"string"},{"items":{"type":"string"},"type":"array"}],"description":"Keyword(s) to rank against name + summary (case-insensitive, synonyms expanded). Array = one group per entry — put one concept in each."},"withSummaries":{"description":"Include one-line summaries (default true).","type":"boolean"}},"type":"object"},"name":"list_methods","title":"List API methods"},{"description":"Fetch documentation in BULK — one call, many documents. Keys can be: v1 methods (\"v1.part.box\" or a unique bare name), topic docs (\"DATA\", \"STRUCTURE\", \"GRAPHICS\"), recipes (\"recipes/verification\" — MANDATORY in every build fetch, \"recipes/clean-construction\" — every assembly and multi-part model, \"recipes/constrained-sketching\", \"recipes/parametric-part\", \"recipes/assembly-parameters\", \"recipes/pattern-then-subtract\", \"recipes/direct-modeling-eif\", \"recipes/buerli-app\"), guides (\"part/expression-workflow\", \"assembly/generic\", …) and domain overviews (\"api/part\"). PLAN FIRST: pick every method you will need from the method index, then request them plus the matching recipe/guide docs in ONE call (up to 24 keys), recipes first. Each response is capped at ~48k chars: docs that don't fit are listed at the TOP as \"NOT included yet\" — request exactly those keys in a follow-up call before building. Docs larger than one response are paged: \"key\" is page 1, \"key#2\" the next (the page footer says so). Unknown keys come back in a \"not found\" section with suggestions. Find recipes/guides by topic with the method search (list_methods), which also returns matching documents.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","properties":{"keys":{"description":"Documentation keys, e.g. [\"DATA\", \"v1.part.extrusion\", \"v1.part.chamfer\", \"recipes/parametric-part\"].","items":{"type":"string"},"maxItems":24,"minItems":1,"type":"array"}},"required":["keys"],"type":"object"},"name":"docs","title":"Fetch documentation (bulk)"},{"description":"Full documentation for ONE key — prefer docs([...]) to fetch everything you need in a single round; use this only for a single follow-up lookup. Accepts full (\"v1.part.box\") or bare (\"box\") names — ambiguous bare names list the candidates. Also serves whole documents (\"DATA\", \"api/part\", \"recipes/parametric-part\"). Same size cap and paging as docs: a large document answers with page 1 and names the next page (\"api/part#2\").","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","properties":{"method":{"description":"Method name (\"v1.part.box\", \"box\"), topic doc (\"DATA\") or recipe (\"recipes/constrained-sketching\", \"recipes/parametric-part\").","type":"string"}},"required":["method"],"type":"object"},"name":"describe_method","title":"Describe API method"},{"description":"Render the current drawing as an inline PNG (also written to disk: outDir, else $CLASSCAD_SNAPSHOT_DIR, else <tmpdir>/classcad-snapshots). The image is returned to the MODEL as an inline image block — no follow-up Read is needed to see it. The USER usually does not see tool results. At the end of a build (not after every tweak), SHOW them the render: with a file-sending tool (Claude Code: SendUserFile), send the saved PNG; otherwise embed it in your reply as a Markdown image with its absolute path, ![render](/abs/path.png) — Codex and most chat hosts display that. Hosts preview only files inside the session's own folders (Claude Code: the scratchpad directory or the project) — anywhere else the user gets a grey placeholder card. So when you intend to send the render, pass outDir = your scratchpad directory (or a folder in the project). Call after a meaningful geometry change, NOT after every parameter tweak. Verification options: section (cut through internals), sheet (four labeled views, shared ortho scale), techDrawing (technical drawing: front/top/side with hidden lines dashed, placed first- or third-angle — compare against a reference drawing), lines (line style: visible edges solid, hidden dashed), highlight (face/edge/body ids in signal color), markers (probe crosshairs at world points), sketchOverlay (sketch curves on their real plane), annotate (extents + axes triad + scale bar), xray (hidden geometry shines through), colors \"distinct\" (one color per body — booleans/splits/patterns), frame (pin an earlier snapshot's reported frame for pixel-comparable before/after).","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","properties":{"annotate":{"description":"Measurement overlay: bbox extents, view-oriented axes triad, scale bar.","type":"boolean"},"colors":{"description":"\"native\" (default): the model's own colors. \"distinct\": one palette color per body.","enum":["native","distinct"],"type":"string"},"drawing":{"description":"The drawing this call works on. \"new\" opens a new, empty drawing, and the answer names its id; from then on pass that id (e.g. \"d-k3v9q2xa\") in every call of this conversation about that model. A drawing belongs to the conversation that opened it: no other conversation can see or change it.","type":"string"},"frame":{"description":"Pin the frame reported by an earlier snapshot (same view/size) for pixel-comparable before/after.","properties":{"midX":{"type":"number"},"midY":{"type":"number"},"scale":{"type":"number"}},"required":["scale","midX","midY"],"type":"object"},"height":{"description":"Pixels (default 900).","maximum":4096,"minimum":64,"type":"integer"},"highlight":{"description":"Ids rendered in signal color: graphic container ids, owning solid ids, face mesh ids, edge ids. CAUTION: face/edge ids are only stable within one graphic payload (recalc reassigns them) — across tool calls use highlightAt.","items":{"type":"number"},"type":"array"},"highlightAt":{"description":"World points [[x,y,z],…]: the closest FACE in the rendered payload is highlighted per point. Geometrically anchored — the robust way to highlight a face found via run_script (return a point on it, not its mesh id).","items":{"items":{"type":"number"},"maxItems":3,"minItems":3,"type":"array"},"type":"array"},"label":{"description":"Filename label. Default \"snapshot\".","type":"string"},"layers":{"description":"Content layers to render. Default [\"solid\"].","items":{"enum":["solid","sketch","curves","workgeo"],"type":"string"},"type":"array"},"lines":{"description":"Line style instead of shading: visible edges and silhouettes solid, hidden edges dashed. Hidden lines show bores, pockets, hollow vs solid. Works for the single view and every sheet panel.","type":"boolean"},"lookAt":{"description":"World-space [x,y,z] that lands at screen center. Omit for bbox center.","items":{"type":"number"},"maxItems":3,"minItems":3,"type":"array"},"markers":{"description":"Probe markers (crosshair + label) at world coordinates, drawn on top.","items":{"properties":{"color":{"items":{"type":"number"},"maxItems":3,"minItems":3,"type":"array"},"label":{"type":"string"},"position":{"items":{"type":"number"},"maxItems":3,"minItems":3,"type":"array"}},"required":["position"],"type":"object"},"type":"array"},"outDir":{"description":"Absolute directory for the PNG (created if missing). Pass your session scratchpad when the user should see the file — hosts preview only files in session folders.","type":"string"},"recalc":{"description":"Default false. Opt in only to regenerate; keep false for solid.*/entity-injection sessions — a recalc invalidates curve shape ids and can destroy injected bodies.","type":"boolean"},"section":{"description":"Cut the solids at a plane; the positive side of the normal is removed. The cut faces are filled and hatched like a drawing's section (wall thicknesses, bores and pockets read directly); cap: false leaves the cut open with interior walls shaded. Combine with techDrawing for a section view.","properties":{"cap":{"type":"boolean"},"normal":{"items":{"type":"number"},"maxItems":3,"minItems":3,"type":"array"},"origin":{"items":{"type":"number"},"maxItems":3,"minItems":3,"type":"array"}},"required":["origin","normal"],"type":"object"},"sheet":{"anyOf":[{"type":"boolean"},{"items":{"anyOf":[{"enum":["iso","top","bottom","front","back","left","right"],"type":"string"},{"description":"Turntable camera in DEGREES (Z-up): azimuth 0 = front, 90 = camera at +X; elevation 0 = horizon, 90 = top.","properties":{"azimuth":{"type":"number"},"elevation":{"type":"number"}},"type":"object"},{"description":"Explicit orthographic look direction (from camera toward the scene).","properties":{"direction":{"items":{"type":"number"},"maxItems":3,"minItems":3,"type":"array"},"up":{"items":{"type":"number"},"maxItems":3,"minItems":3,"type":"array"}},"required":["direction"],"type":"object"}]},"maxItems":4,"minItems":4,"type":"array"},{"items":{"anyOf":[{"enum":["iso","top","bottom","front","back","left","right"],"type":"string"},{"description":"Turntable camera in DEGREES (Z-up): azimuth 0 = front, 90 = camera at +X; elevation 0 = horizon, 90 = top.","properties":{"azimuth":{"type":"number"},"elevation":{"type":"number"}},"type":"object"},{"description":"Explicit orthographic look direction (from camera toward the scene).","properties":{"direction":{"items":{"type":"number"},"maxItems":3,"minItems":3,"type":"array"},"up":{"items":{"type":"number"},"maxItems":3,"minItems":3,"type":"array"}},"required":["direction"],"type":"object"}]},"maxItems":2,"minItems":2,"type":"array"}],"description":"Multi-view sheet in ONE image. true or 4 views = quadrants (default top/iso/front/right; ortho views share one scale). 2 views = side-by-side panels labeled A | B — use for the mirror check: [matched view, same view with negated azimuth] in a single render."},"sketchOverlay":{"description":"Draw sketch curves in 3D on their actual plane over the solid render.","type":"boolean"},"source":{"description":"\"stl\": render the tessellated STL export instead of the engine graphic (explicit fallback; no brep edges).","enum":["graphic","stl"],"type":"string"},"supersample":{"description":"Anti-aliasing: render at k× and downscale to width×height (default 2; 1 = raw aliased pixels). Output size and image tokens are unchanged.","maximum":4,"minimum":1,"type":"integer"},"techDrawing":{"anyOf":[{"type":"boolean"},{"enum":["first-angle","third-angle"],"type":"string"},{"properties":{"iso":{"type":"boolean"},"projection":{"enum":["first-angle","third-angle"],"type":"string"},"side":{"enum":["left","right"],"type":"string"}},"type":"object"}],"description":"Technical drawing in ONE image: front, top and side view in line style (hidden edges dashed), aligned at one scale, plus a shaded iso. \"first-angle\" (ISO E, Europe; true): top view BELOW front, view from the left RIGHT of it. \"third-angle\" (ISO A, US): top view ABOVE front, view from the right RIGHT of it. Use the method of the reference drawing, then compare view by view. Takes precedence over sheet."},"view":{"anyOf":[{"enum":["iso","top","bottom","front","back","left","right"],"type":"string"},{"description":"Turntable camera in DEGREES (Z-up): azimuth 0 = front, 90 = camera at +X; elevation 0 = horizon, 90 = top.","properties":{"azimuth":{"type":"number"},"elevation":{"type":"number"}},"type":"object"},{"description":"Explicit orthographic look direction (from camera toward the scene).","properties":{"direction":{"items":{"type":"number"},"maxItems":3,"minItems":3,"type":"array"},"up":{"items":{"type":"number"},"maxItems":3,"minItems":3,"type":"array"}},"required":["direction"],"type":"object"}],"description":"Camera: named view (default \"iso\") or arbitrary orthographic camera."},"width":{"description":"Pixels (default 1200).","maximum":4096,"minimum":64,"type":"integer"},"xray":{"description":"Translucent bodies — hidden geometry shines through.","type":"boolean"},"zoom":{"description":"Multiplier on auto-fit scale. 1=fit-all (default), >1 zooms in.","maximum":50,"minimum":0.05,"type":"number"}},"required":["drawing"],"type":"object"},"name":"snapshot","title":"Snapshot drawing"},{"description":"Execute JavaScript against the CAD session — THE tool for any build involving computation, repetition, or more than a handful of operations. The script runs as an async function body with:\n• api.v1.<domain>.<method>(params) — ClassCAD calls, await-able, → { result, maxLevel, messages }. Typos throw immediately with suggestions. Strict: a call that ends at maxLevel ≥ 51 THROWS (the message carries the engine error) — method docs describing \"null/[] with maxLevel 51\" are the non-script result; wrap intentional probes (e.g. getGeometryIds where a miss is expected) in try/catch.\n• await api.tree({ refresh? }) — the structure tree (id → node): find parts, features, sketches by class/name. Returns a Promise: without await, Object.values(api.tree()) is silently [] (looks like an empty drawing).\n• await api.graphic({ recalc? }) — the graphic payload (containers with face meshes, edges, vertices): find and FILTER GEOMETRY yourself — e.g. locate a bore wall by vertex radius, collect edge ids for a chamfer. Exact shapes + selection idioms: docs([\"DATA\"]).\n• Math, full JS (variables, loops, functions); console.log/log(...) captured and returned.\n• return <small summary> — results are size-capped; keep big data in the drawing, not the return value.\nCompute coordinates IN the script (trigonometry, loops) instead of inlining hand-evaluated numbers. Pass recalc:false to api.graphic() in solid.*/entity-injection sessions (a recalc invalidates curve shape ids and can destroy injected bodies in complex cases). No DOM/network/filesystem access; awaited work times out (default 60s). Prefer several small verified scripts over one huge one — STATE PERSISTS in the drawing between scripts: a follow-up script ATTACHES to the existing model (re-discover via await api.tree(); tree ids are stable; NEVER part.create when a part already exists). Even a single operation is a run_script.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","properties":{"drawing":{"description":"The drawing this call works on. \"new\" opens a new, empty drawing, and the answer names its id; from then on pass that id (e.g. \"d-k3v9q2xa\") in every call of this conversation about that model. A drawing belongs to the conversation that opened it: no other conversation can see or change it.","type":"string"},"label":{"description":"Short label describing what this script does.","type":"string"},"script":{"description":"JavaScript source. Executed as an async function body — use await directly, return a (small) summary value.","type":"string"},"timeoutMs":{"description":"Timeout for awaited work in ms (default 60000).","maximum":300000,"minimum":1000,"type":"integer"}},"required":["drawing","script"],"type":"object"},"name":"run_script","title":"Run script"}]}}}
