improve_generation_prompt
Revise a 3D generation prompt from print feedback by adding physical constraints that fix printability and structural issues while preserving creative intent.
Instructions
Generate an improved prompt from feedback.
Adds physical constraints to the original prompt to address
printability and structural issues, without modifying the
creative intent.
The improved prompt is run through a three-check sanity gate
(no contradictions, fits the provider budget, ≥70% original-token overlap so intent
is preserved). When ``enforce_sanity=True`` (default) and
the gate fails, this tool refuses with
``code="SANITY_GATE_FAILED"`` and returns the failure list
instead of a contradictory prompt. Callers that genuinely
want the failed prompt — for inspection, repair, or model
self-correction — set ``enforce_sanity=False`` and read
``improved_prompt.sanity`` from the response.
Args:
original_prompt: The original generation prompt.
failure_mode: Optional failure mode if the model was printed
and failed (e.g. ``"adhesion"``, ``"spaghetti"``).
max_overhang_angle: Maximum overhang angle detected.
min_wall_thickness: Minimum wall thickness detected.
has_bridges: Whether bridges were detected.
iteration: Which retry iteration this is.
file_path: Optional path to the STL file for structural
analysis. When provided, the tool also analyzes
structural risks and folds them into the improved
prompt.
enforce_sanity: When True (default), refuse the
response if the prompt sanity gate fails. Pass
False to receive a contradictory prompt anyway —
useful when the agent intends to repair it before
sending to the generator.
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": {
"original_prompt": "<original_prompt>"
},
"name": "improve_generation_prompt"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | No | Optional path to the STL file for structural analysis. When provided, the tool also analyzes structural risks and folds them into the improved prompt. | |
| iteration | No | Which retry iteration this is. Default: 1. | |
| has_bridges | No | Whether bridges were detected. Default: false. | |
| failure_mode | No | Optional failure mode if the model was printed and failed (e.g. ``"adhesion"``, ``"spaghetti"``). | |
| enforce_sanity | No | When True (default), refuse the response if the prompt sanity gate fails. Pass False to receive a contradictory prompt anyway — useful when the agent intends to repair it before sending to the generator. Default: true. | |
| original_prompt | Yes | The original generation prompt. | |
| max_overhang_angle | No | Maximum overhang angle detected. | |
| min_wall_thickness | No | Minimum wall thickness detected. |