Skip to main content
Glama

optimize_template_params

Sweep template parameters, generate OpenSCAD variants, run structural analysis, and return the strongest configuration to optimize part dimensions.

Instructions

Find the structurally strongest version of a parametric template.

        Sweeps each template parameter across its [min, max] range at
        evenly spaced sample points, generates every combination via
        OpenSCAD, runs structural analysis on each variant, and returns
        the configuration with the highest structural score.

        Use this when you want to **automatically** find optimal dimensions
        for a functional part -- e.g. "what wall thickness and bracket
        height give the strongest shelf bracket?"

        :param template_id: Template ID from the design template library.
        :param samples_per_param: Sample points per parameter (default 3).
        :param max_variants: Maximum total variants to test (default 27).
        :param constraints: JSON string of constraints, e.g.
               ``{"max_width_mm": 100, "max_height_mm": 50}``.
        :param output_dir: Directory for generated STLs (temp dir if empty).
        :returns: Dict with best_params, best_score, best_grade, best_stl_path,
                  variants_tested, all_scores, and summary.

INLINE 3D STAGE: on success this tool also 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.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
output_dirNo
constraintsNo
template_idYes
max_variantsNo
samples_per_paramNo
Install Server

TDQS

A4.7/5.0
Behavior5/5

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

With no annotations provided, the description carries the full burden and does an excellent job. It discloses the side effect of opening an interactive 3D stage, automatic mesh decimation, and the full return payload structure (best_params, best_score, best_grade, etc.). This goes well beyond basic operation and helps the agent anticipate consequences.

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 well-structured, beginning with a one-sentence summary, then a mechanism explanation, a usage hint, and param docs. It could be slightly tighter, but every section earns its place given the tool's complexity and the need to document side effects and return values.

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?

The tool is complex (5 params, no output schema, no annotations), yet the description covers the workflow, parameter details, return values, and even the inline 3D stage side effect. An agent has everything needed to invoke the tool correctly and understand the result without additional documentation.

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

Parameters5/5

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

Schema description coverage is 0%, but the description provides :param lines for all five parameters, explaining template_id, samples_per_param, max_variants, constraints, and output_dir with a JSON constraints example. This fully compensates for the missing schema descriptions and adds meaning beyond the bare schema titles.

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: 'Find the structurally strongest version of a parametric template.' It then explains the mechanism (sweeping parameters, generating combinations, running structural analysis) and clearly distinguishes itself from siblings like analyze_structural_risks or iterate_design by focusing on automatic parameter optimization.

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?

The description explicitly states when to use the tool: 'Use this when you want to automatically find optimal dimensions for a functional part,' with a concrete example. It does not explicitly mention alternatives or exclusions, but the use case is clear enough to guide selection among the many sibling design tools.

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

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/codeofaxel/kiln'

If you have feedback or need assistance with the MCP directory API, please join our Discord server