Skip to main content
Glama
RobertCoop

OpenSCAD MCP Server

by RobertCoop

export_model

Convert OpenSCAD code or files into STL, 3MF, AMF, OFF, NEF3, DXF, SVG, PDF, or CSG formats, with optional multi-part exports and mesh health validation.

Instructions

Export OpenSCAD code or file to a mesh, 2D, or CSG format. With parts=[{name, code, place?}] every part is exported separately (in its assembly position) and bundled into one 3MF with named objects, or into a directory of STLs when output_format="stl"; a manifest is returned.

Mesh exports (stl, 3mf, amf, off, nef3) also return a "mesh_health" block from OpenSCAD's CGAL statistics: "manifold" is true, false, or null when OpenSCAD did not perform the check. A non-manifold result usually means parts touch along an edge or face; overlap them slightly.

Args: scad_content: OpenSCAD code to export (mutually exclusive with scad_file) scad_file: Path to OpenSCAD file (mutually exclusive with scad_content) output_format: "stl", "3mf", "amf", "off", "nef3" (3D), "dxf", "svg", "pdf" (2D), or "csg" (evaluated CSG tree). Default "stl". output_path: Path to write the exported file. If not specified, a temp directory is used. variables: Variables to pass to OpenSCAD via -D flags include_paths: Additional include paths for OpenSCAD via the OPENSCADPATH environment variable ctx: MCP context for logging

Returns: Dict with success status, output_path, format, file_size_bytes, mesh_health (mesh formats), warnings, errors, and hints

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
partsNo
qualityNo
scad_fileNo
variablesNo
output_pathNo
scad_contentNo
include_pathsNo
output_formatNostl

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.6.1
    • addedInput schema / properties / parts
      Added value: +{
      +  "anyOf": [
      +    {
      +      "items": {
      +        "additionalProperties": true,
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null
      +}
    • addedInput schema / properties / quality
      Added value: +{
      +  "default": null,
      +  "title": "Quality"
      +}
  2. Addedv0.3.0

TDQS

A4.3/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and delivers rich behavioral detail. It discloses the return dict structure, temporary output_path behavior, parts bundling into 3MF or STLs, manifest return, and mesh_health semantics including the meaning of manifold true/false/null and the typical cause of non-manifold results. It even advises overlap adjustments, which agents can act on.

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 description is long but appropriately so for an 8-parameter tool with no schema descriptions. It front-loads the core purpose and parts behavior, then adds mesh_health guidance, then systematically documents parameters. No sentence is filler, though the first paragraph could be tightened by moving parts details into the Args section.

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

Completeness4/5

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

Given no annotations, 0% schema coverage, and an output schema already present, the description is largely complete: it covers return values, error hints, format choices, and typical failure causes. The omission of the 'quality' parameter is the most notable gap, and it also does not mention prerequisites like OpenSCAD installation, though sibling check_openscad may cover that.

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 0%, so the description must compensate, and it largely does: it explains scad_content/scad_file mutual exclusivity, output_format values with default, output_path fallback, variables via -D, include_paths via OPENSCADPATH, and parts structure in the intro. The main gap is the 'quality' parameter, which is never described, and 'parts' is not restated in the Args block, leaving that schema field partially uncovered.

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 description opens with a specific verb and resource: 'Export OpenSCAD code or file to a mesh, 2D, or CSG format.' It clearly names the output families and even details the parts-bundling behavior, which makes the tool's function unmistakable. This distinguishes it from siblings like render, measure, and validate, which focus on other stages of the pipeline.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives strong context about what the tool does and how it behaves, such as mutual exclusivity of scad_content and scad_file, and the parts export mode. However, it never explicitly contrasts this tool with sibling tools or says when to use export_model over alternatives like render or model. Usage is implied by the verb 'export' rather than stated as guidance.

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