Skip to main content
Glama

solve_template_constraints

Read-only

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

NameRequiredDescriptionDefault
constraintsYesJSON 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_idYesTemplate identifier (e.g., "shelf_bracket").

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv1.5.1
    • addedInput schema / properties / constraints / description
      Added value: +"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]}``)."
    • addedInput schema / properties / template_id / description
      Added value: +"Template identifier (e.g., \"shelf_bracket\")."
  2. First observedv0.1.0

TDQS

A3.6/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false and openWorldHint=false, and the description adds real context beyond that: the solver is iterative, it respects the template's declared ranges, and it reports unsatisfiable constraints. It is silent on whether anything is persisted to the template or on any cost/latency of the iterative solve, which keeps it short of a 5.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The opening two sentences are front-loaded and useful, and the returns block earns its place given there is no output schema. However, the :param lines duplicate the schema descriptions word for word with no added information, which is wasted text in a docstring-style block.

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

Completeness4/5

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

With no output schema, the description carries the burden of explaining returns and does so well, enumerating solved_params, satisfied/violated constraints, dof, free and defaults_applied, plus a caution about min/max bounding without pinning a value. It is only missing what happens when constraints are jointly unsatisfiable (error vs. partial result).

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%, and the parameter prose in the description is essentially verbatim the same text as the schema's property descriptions (including the identical constraint example and the ratio form). Baseline 3 applies since the schema is doing the work and the description adds no new semantics.

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 verb and resource ('Solve parametric constraints to find valid template parameters') and explains the mechanism ('iteratively adjusts parameters... staying within the template's declared parameter ranges'). It does not, however, distinguish itself from closely related siblings such as optimize_template_params or validate_scad_parameters, so an agent must infer the boundary.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is only implied: the agent can infer it should call this when it has a template plus min/max/equals/ratio constraints. There is no explicit statement of when to prefer this over optimize_template_params or validate_scad_parameters. The closing instruction about telling the user what was left free is output-handling guidance rather than tool-selection 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