Skip to main content
Glama

validate_openscad_code

Read-only

Checks OpenSCAD code and returns structured errors and warnings with line numbers, without generating geometry. Use it to verify code before compiling a 3D model, so mistakes surface early with clear line references.

Instructions

Validate OpenSCAD code without generating geometry.

Compiles the code and returns structured error/warning information
with line numbers.  Use this to check code before calling
generate_model with OpenSCAD.

:param scad_code: OpenSCAD source code to validate — the same parameter
    name ``compile_scad`` / ``analyze_scad_code`` / ``tweak_and_compile_scad``
    take, so a session that has been compiling can validate without
    learning a second spelling.
:param code: Alias of ``scad_code`` kept for callers that learned it.
:returns: Dict with ``valid``, ``errors``, and ``warnings``.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "validate_openscad_code"
  }
}

Input Schema

NameRequiredDescriptionDefault
codeNoAlias of ``scad_code`` kept for callers that learned it. Default: "".
scad_codeNoOpenSCAD source code to validate — the same parameter name ``compile_scad`` / ``analyze_scad_code`` / ``tweak_and_compile_scad`` take, so a session that has been compiling can validate without learning a second spelling. Default: "".

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv1.5.1
    • changedInput schema / properties / code / description
      Previous value: -"Default: \"\"."New value: +"Alias of ``scad_code`` kept for callers that learned it. Default: \"\"."
    • changedInput schema / properties / scad_code / description
      Previous value: -"Default: \"\"."New value: +"OpenSCAD source code to validate — the same parameter name ``compile_scad`` / ``analyze_scad_code`` / ``tweak_and_compile_scad`` take, so a session that has been compiling can validate without learning a second spelling. Default: \"\"."
  2. Changed3 schema fields changedv1.5.0
    • addedInput schema / properties / code / description
      Added value: +"Default: \"\"."
    • addedInput schema / properties / scad_code
      Added value: +{
      +  "description": "Default: \"\".",
      +  "title": "Scad Code",
      +  "type": "string"
      +}
    • removedInput schema / required
      Removed value: -[
      -  "code"
      -]
  3. First observedv0.1.0

TDQS

A4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false, and openWorldHint=false. The description adds useful behavior beyond that: it compiles the code, returns structured errors and warnings with line numbers, and explicitly avoids geometry generation.

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 purpose and usage guidance are front-loaded and easy to scan. The Sphinx-style parameter and return sections duplicate schema content, which is slightly redundant but not harmful.

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 a simple validation tool with full schema coverage and annotations covering safety, the description is complete. It explains the compile-and-report behavior and the return shape, so an agent has enough to invoke it correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents both parameters. The description repeats the same parameter details, including the alias relationship, without adding syntax or format guidance beyond the schema.

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

Purpose4/5

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

The description states a specific verb and resource: validate OpenSCAD code without generating geometry, and it distinguishes this from generate_model. It does not clearly differentiate from sibling tools like analyze_scad_code or compile_scad, so it falls short of a 5.

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?

It gives a clear usage context: check code before calling generate_model with OpenSCAD. It does not name when to use this instead of analyze_scad_code or compile_scad, and it provides no exclusions.

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