Skip to main content
Glama

insert_into_scad

Read-only

Insert OpenSCAD code into an existing module without replacing it, adding targeted geometry such as ventilation or screw holes at the start or end.

Instructions

Insert code into an OpenSCAD module without replacing it.

        Adds geometry or operations inside a module. Use for targeted
        additions like "add ventilation holes to the top panel" or
        "add screw holes to the base."

        Args:
            scad_code: OpenSCAD source code.
            module_name: Module to modify (e.g. "base_plate").
            code_to_insert: OpenSCAD code to insert.
            position: "end" (before closing brace) or "start" (after
                opening brace). Default: "end".
        

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>",
      "module_name": "<module_name>",
      "code_to_insert": "<code_to_insert>"
    },
    "name": "insert_into_scad"
  }
}

Input Schema

NameRequiredDescriptionDefault
positionNo"end" (before closing brace) or "start" (after opening brace). Default: "end". Default: "end".
scad_codeYesOpenSCAD source code.
module_nameYesModule to modify (e.g. "base_plate").
code_to_insertYesOpenSCAD code to insert.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv1.5.1
    • addedInput schema / properties / code_to_insert / description
      Added value: +"OpenSCAD code to insert."
    • addedInput schema / properties / module_name / description
      Added value: +"Module to modify (e.g. \"base_plate\")."
    • changedInput schema / properties / position / description
      Previous value: -"Default: \"end\"."New value: +"\"end\" (before closing brace) or \"start\" (after opening brace). Default: \"end\". Default: \"end\"."
    • addedInput schema / properties / scad_code / description
      Added value: +"OpenSCAD source code."
  2. Changed2 schema fields changedv1.5.0
    • removedInput schema / properties / position / default
      Removed value: -"end"
    • addedInput schema / properties / position / description
      Added value: +"Default: \"end\"."
  3. First observedv0.1.0

TDQS

A3.8/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false and openWorldHint=false, so the safety profile is covered. The description adds the important non-clobbering behavior (existing module content is preserved), but is silent on whether it returns the modified source string versus mutating the input, and on what happens if module_name is not found — a meaningful gap for a code-transformation tool with no output schema.

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 core purpose and use cases are front-loaded in two short sentences with zero waste. The trailing Args section is redundant with a 100%-covered schema and slightly bloats an otherwise tight definition.

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

Completeness3/5

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

For a simple 4-parameter, non-destructive string-transform tool the gist is clear, but with no output schema the description should say what comes back (modified OpenSCAD source) and how failures surface. Neither is present, leaving an agent to guess at return handling.

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 every parameter is already documented, and the description's Args block largely restates the schema verbatim (including the duplicated "Default: end" note). It adds no new semantics such as whether position is case-sensitive or how nested modules are resolved, so baseline 3 applies.

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?

States a specific verb and resource ("Insert code into an OpenSCAD module") plus a scope qualifier ("without replacing it") that separates it from sibling modify_scad_module / tweak_and_compile_scad, which replace or recompile. An agent can pick this tool without opening any schema.

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 concrete when-to-use triggers ("add ventilation holes to the top panel", "add screw holes to the base"), which is real routing guidance. It never names the alternative tools or states when NOT to use it (e.g. for whole-module rewrites use modify_scad_module), so it stops short of full exclusion guidance.

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