Skip to main content
Glama

modify_scad_module

Read-only

Replace a named module in OpenSCAD source code with a complete new implementation to redesign or substantially modify a component.

Instructions

Replace a module in OpenSCAD code with new implementation.

        Finds the named module and replaces its body entirely. Use for
        major modifications like redesigning a component.

        Args:
            scad_code: OpenSCAD source code.
            module_name: Module to replace (e.g. "top_panel").
            new_module_code: Complete new module code including the
                module declaration and braces.
        

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>",
      "new_module_code": "<new_module_code>"
    },
    "name": "modify_scad_module"
  }
}

Input Schema

NameRequiredDescriptionDefault
scad_codeYesOpenSCAD source code.
module_nameYesModule to replace (e.g. "top_panel").
new_module_codeYesComplete new module code including the module declaration and braces.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv1.5.1
    • addedInput schema / properties / module_name / description
      Added value: +"Module to replace (e.g. \"top_panel\")."
    • addedInput schema / properties / new_module_code / description
      Added value: +"Complete new module code including the module declaration and braces."
    • addedInput schema / properties / scad_code / description
      Added value: +"OpenSCAD source code."
  2. First observedv0.1.0

TDQS

A3.8/5.0
Behavior4/5

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

The annotations already declare readOnlyHint=true, destructiveHint=false, and openWorldHint=false. The description adds useful behavioral detail beyond those annotations: it finds the named module and replaces its body entirely, and it frames this as a major redesign operation. It does not cover missing-module handling, duplicate names, or return behavior, but with annotations present this is a solid disclosure.

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 front-loaded, clearly separated into purpose, mechanism, usage, and an Args list. It is appropriately sized with little waste, though the first two sentences overlap slightly in restating the replacement action.

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?

It covers the purpose, mechanism, usage, and all parameters, but there is no output schema and the description never states whether the tool returns the modified code, mutates the supplied string, or how errors like a missing module name are handled. Those gaps matter for an agent invoking a code-transformation tool.

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 input schema already documents all three parameters. The description largely mirrors those schema descriptions and adds no meaningful syntax, constraints, or edge-case guidance beyond what the schema provides.

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 action on a specific resource: replacing a named OpenSCAD module with a full new implementation. The phrase 'replaces its body entirely' clarifies the mechanism and implicitly distinguishes it from narrower SCAD edits such as parameter updates, though it does not explicitly name sibling tools.

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 clear usage context with 'Use for major modifications like redesigning a component,' which helps an agent decide when whole-module replacement is appropriate. It does not explicitly name alternatives or when-not-to-use cases, so it falls short of a 5.

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