Skip to main content
Glama

tweak_and_compile_scad

Change a numeric parameter in OpenSCAD source, validate it against material limits, and recompile the model to a new STL in one step.

Instructions

Update a parameter in OpenSCAD code and recompile to STL.

        The complete parametric tweaking workflow: changes a dimension
        variable, validates against material limits, and compiles a new
        STL — all in one step. Perfect for "make it 5mm wider" requests.

        A tweak that leaves a piece floating with nothing under it is
        refused like a compile is (``code: "FLOATING_PIECES"``, the fix
        in ``error``).  ``color`` shows the part in the colour the user
        asked for, as on ``compile_scad``.

        Args:
            goal_id: The saved goal's id from ``design_session``, so this make
                is recorded against the goal and checked against it. Empty when
                there is no goal.
            scad_code: OpenSCAD source code.
            parameter_name: Variable name to update (e.g. "wall_thickness").
            new_value: New numeric value.
            material: Optional material for limit validation (e.g. "pla").
            color: The colour the user asked for, shown on the preview and
                the stage (a name or ``#rrggbb``).  Not a print setting.

INLINE 3D STAGE: on success this tool opens Kiln's interactive 3D stage — an inline viewer panel the user can orbit, zoom, and turn over — in hosts that render MCP Apps panels (Kiln's hosted connection attaches a browser stage link for hosts that don't). Oversized meshes are decimated automatically for the stage; the PNG preview is the floor, not the whole experience.

MAKE DOORS: design_session, Kiln's front door for making an object, is not installed here (signed in to Kiln it runs on Kiln's servers). On this install compile_scad IS the make → preview → iterate loop: make it, show the preview, iterate.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "scad_code": "<scad_code>",
      "parameter_name": "<parameter_name>",
      "new_value": "<new_value>"
    },
    "name": "tweak_and_compile_scad"
  }
}

Input Schema

NameRequiredDescriptionDefault
colorNoThe colour the user asked for, shown on the preview and the stage (a name or ``#rrggbb``). Not a print setting. Default: "".
goal_idNoThe saved goal's id from ``design_session``, so this make is recorded against the goal and checked against it. Empty when there is no goal. Default: "".
materialNoOptional material for limit validation (e.g. "pla").
new_valueYesNew numeric value.
scad_codeYesOpenSCAD source code.
parameter_nameYesVariable name to update (e.g. "wall_thickness").

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv1.6.0
    • removedInput schema / properties / brief_id
      Removed value: -{
      -  "description": "The saved goal's id from ``design_session``, so this make is recorded against the goal and checked against it. Empty when there is no goal. Default: \"\".",
      -  "title": "Brief Id",
      -  "type": "string"
      -}
    • addedInput schema / properties / goal_id
      Added value: +{
      +  "description": "The saved goal's id from ``design_session``, so this make is recorded against the goal and checked against it. Empty when there is no goal. Default: \"\".",
      +  "title": "Goal Id",
      +  "type": "string"
      +}
  2. Changed6 schema fields changedv1.5.1
    • changedInput schema / properties / brief_id / description
      Previous value: -"Default: \"\"."New value: +"The saved goal's id from ``design_session``, so this make is recorded against the goal and checked against it. Empty when there is no goal. Default: \"\"."
    • changedInput schema / properties / color / description
      Previous value: -"Default: \"\"."New value: +"The colour the user asked for, shown on the preview and the stage (a name or ``#rrggbb``).  Not a print setting. Default: \"\"."
    • addedInput schema / properties / material / description
      Added value: +"Optional material for limit validation (e.g. \"pla\")."
    • addedInput schema / properties / new_value / description
      Added value: +"New numeric value."
    • addedInput schema / properties / parameter_name / description
      Added value: +"Variable name to update (e.g. \"wall_thickness\")."
    • addedInput schema / properties / scad_code / description
      Added value: +"OpenSCAD source code."
  3. Changed3 schema fields changedv1.5.0
    • addedInput schema / properties / brief_id
      Added value: +{
      +  "description": "Default: \"\".",
      +  "title": "Brief Id",
      +  "type": "string"
      +}
    • addedInput schema / properties / color
      Added value: +{
      +  "description": "Default: \"\".",
      +  "title": "Color",
      +  "type": "string"
      +}
    • removedInput schema / properties / material / default
      Removed value: -null
  4. First observedv0.1.0

TDQS

A3.7/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=false, destructiveHint=false and openWorldHint=false. The description goes beyond them usefully: it discloses the FLOATING_PIECES refusal and its error field, material-limit validation, goal recording, automatic mesh decimation for the stage, and that color is not a print setting. That is solid added behavioral context, though the outcome when material limits fail is not spelled out.

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

Conciseness3/5

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

The core workflow and the Args block are front-loaded and readable, but the INLINE 3D STAGE and MAKE DOORS sections are long, promotional in tone, and partly about install topology rather than this tool's behavior. They carry some routing value but inflate the definition well past what the task needs.

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?

With six parameters, no output schema, and mutation semantics, the description does most of the load-bearing work: it covers the compile result, the preview/stage return experience, and one failure mode with its error code. It is nearly complete; the missing piece is what a material-limit rejection looks like and whether a failed recompile leaves the previous STL intact.

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 coverage is 100%, so the baseline is 3. The description adds real meaning: goal_id ties the make to a saved goal and is checked against it, color drives preview and stage but is not a print setting, and material triggers limit validation — details that clarify how the parameters interact rather than just restating them.

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?

States a specific verb and resource: updates a named variable in OpenSCAD source and recompiles to STL, framed as "the complete parametric tweaking workflow … all in one step." That framing implicitly separates it from the single-step siblings (update_scad_parameter, compile_scad), though no sibling is named explicitly, so it falls short of the top band.

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?

Gives a concrete trigger phrase ("Perfect for 'make it 5mm wider' requests") and a whole routing paragraph explaining that design_session is unavailable here and that make-preview-iterate runs through compile_scad. It never explicitly says when to pick this over update_scad_parameter or compile_scad individually, which is the one real gap.

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