solve_template_constraints
Finds valid template parameters by adjusting values within declared ranges to satisfy min, max, equals, and ratio constraints.
Instructions
Solve parametric constraints to find valid template parameters.
Given a template and constraints (min/max/equals/ratio), iteratively
adjusts parameters to satisfy all constraints while staying within
the template's declared parameter ranges.
:param template_id: Template identifier (e.g., "shelf_bracket").
:param constraints: JSON object mapping param names to constraint dicts.
Example: ``{"width": {"min": 20, "max": 50}, "height": {"equals": 30}}``
Supported keys: min, max, equals, ratio (e.g. ``{"ratio": ["width", 0.5]}``).
:returns: Dict with solved_params, satisfied/violated constraints,
plus ``dof`` (how many parameters no constraint pinned),
``free`` (one sentence per unpinned parameter and the value it
was left at) and ``defaults_applied``. Tell the person what
was left free rather than silently accepting a default:
``min``/``max`` bound a parameter without choosing it.
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": {
"template_id": "<template_id>",
"constraints": "<constraints>"
},
"name": "solve_template_constraints"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| constraints | Yes | JSON object mapping param names to constraint dicts. Example: ``{"width": {"min": 20, "max": 50}, "height": {"equals": 30}}`` Supported keys: min, max, equals, ratio (e.g. ``{"ratio": ["width", 0.5]}``). | |
| template_id | Yes | Template identifier (e.g., "shelf_bracket"). |