Skip to main content
Glama
TheTsungYing

io.github.TheTsungYing/annealbridge

validate_optimization_problem

Checks an optimization problem before solving: reports semantic errors with recommended actions, warnings, and compiled variable count estimate to avoid wasting remote solver quota.

Instructions

Check a structured optimization problem without solving it.

Returns semantic errors (each with a recommended_action), advisory
warnings, and an estimate of the compiled variable count including slack
bits. Call this before solve_optimization when planning to use a remote
backend, so problems can be fixed before spending quota, or when the
problem is large (many variables, wide integer ranges). On a local backend
solve_optimization can be called directly: an invalid document returns
status invalid_problem with the same errors and recommended_action.
Nothing is compiled or solved and no network requests are made.
solve_optimization reports the same warnings for the same backend, so
skipping this call never hides them; calling it first only saves the
solve.

A field the schema does not declare is a tool error naming its path,
never ignored: check the schema (get_optimization_capabilities with
include_schema: true returns it as problem_json_schema) before inventing
one.

The estimate follows the model type the chosen backend compiles to. On a
bqm backend it counts the slack bits of every inequality constraint plus
the binary-encoding bits of every integer variable, so a wider
lower_bound..upper_bound range costs more compiled variables. On a cqm
backend integer variables are native and no encoding bits are counted.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
problemYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
validYesDecided by errors alone. Warnings are advisory and never make a problem invalid.
errorsNoEvery error found in one pass — validation does not stop at the first. Empty means the problem is safe to compile.
warningsNoAdvisory findings that do not block a solve. Only produced when there are no errors.
model_typeNoWhich compiler path the estimate assumed. Null when the problem is invalid.
objective_scaleNoThe upper bound on the objective's range, used to size hard penalties and to judge whether a soft weight is meaningful. Null when the problem is invalid.
estimated_compiled_variablesNoCompiled size without building a model: on the BQM path, binary variables + integer-encoding bits + slack bits; on the CQM path, variables + integer slacks. Null when the problem is invalid.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.9/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 meets it: it states that nothing is compiled or solved, no network requests are made, and that solve_optimization reports the same warnings. It also discloses the strict unknown-field behavior, which is exactly the kind of non-obvious trait an agent needs to know.

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

Conciseness5/5

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

The description is long but every sentence earns its place: return contents, usage conditions, side-effect guarantees, schema-checking advice, and estimate semantics are all packed in without repetition. The most important scoping information, 'without solving it,' is front-loaded in the first sentence.

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 description covers return contents, when to call versus alternatives, side effects, unknown-field policy, and backend-dependent estimation semantics. Since an output schema exists, the shape of return values need not be restated. Nothing an agent needs to decide whether and how to invoke this tool is missing.

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

Parameters4/5

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

The single 'problem' parameter has no top-level schema description (0% coverage), so the description must compensate. It does add meaningful behavior: undeclared fields become tool errors, integer range width affects the compiled-variable estimate, and bqm/cqm backends count variables differently. However, it does not summarize the required structure of the problem object itself, leaving that to the embedded $ref definition.

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: 'Check a structured optimization problem without solving it,' and then names what the tool returns (semantic errors, advisory warnings, compiled-variable estimate). It clearly differentiates itself from the sibling solve_optimization by framing this as a pre-solve validation step for remote backends.

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

Usage Guidelines5/5

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

It gives explicit when-to-use guidance: call before solve_optimization for remote backends or large problems, and skip it on local backends where solve_optimization returns the same errors directly. It even states that skipping this call never hides warnings, so the agent knows exactly what is and is not gained by calling it.

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