Skip to main content
Glama

Optimatika Optimisation Service

Solve an optimisation model

solve
Read-onlyIdempotent

Solves a linear, quadratic or mixed-integer optimisation model and returns the solution state, the objective value and each variable's value by name. Give the model as text, in LP format unless 'format' says otherwise. For example: Maximize obj: 3 x + 5 y Subject To budget: x + y <= 10 Bounds 0 <= x <= 8 General x End A coefficient goes before its variable with a space, as in 3 x: there is no * for that, no division and no parentheses. Variables go on the left-hand side, and a single number on the right. Squares and products go together inside one pair of square brackets, each with its coefficient inside too, written as a single number: [ 0.5 x ^2 + 0.004 x * y + 3 y ^2 ], not 0.5 [ x ^2 ] or 2 * 0.002 x * y. A variable is 0 or more unless Bounds says otherwise; General makes it integer, Binary 0 or 1. What is not LP format is an error that names the line. A long solve reports progress, if asked for. OPTIMAL means proven optimal; FEASIBLE means a solution was found but not proven optimal, typically because a time limit was reached. The objective and the variables' values are given only with a solution, and 'note' explains any other state.

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": {
      "model": "<model>"
    },
    "name": "solve"
  }
}

Input Schema

NameRequiredDescriptionDefault
modelYesThe model, as text
senseNoMinimise or maximise. Overrides what the model says; LP and MPS models say it themselves, EBM ones do not
formatNoLP (CPLEX LP format), MPS, or EBM (ojAlgo's own)LP

Output Schema

NameRequiredDescriptionDefault
noteNoWhat the state means, when it is not OPTIMAL
stateYesOPTIMAL, DISTINCT (optimal and the only optimum), FEASIBLE, INFEASIBLE, UNBOUNDED, APPROXIMATE, FAILED, or another of ojAlgo's solution states
optimalYes
feasibleYes
objectiveNoAbsent unless there is a solution
variablesNoEach variable's value, by name. Absent unless there is a solution

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already cover safety (readOnly, idempotent, non-destructive, closed-world). The description adds real behaviour: error reporting that names the offending line, default non-negativity, what General/Binary do, meaning of OPTIMAL vs FEASIBLE, and that objective/variable values appear only with a solution. The phrase 'A long solve reports progress, if asked for' is vague because no progress parameter exists in the schema.

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?

Purpose and return values are front-loaded, and the syntax rules are dense rather than padded. The counterexample negative cases ('not 0.5 [ x ^2 ] or 2 * 0.002 x * y') cost length but plausibly prevent malformed input, so they largely earn their place.

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?

A complex modelling tool with an output schema present, so return values need not be explained even though they are. The syntax specification is thorough for LP; MPS and EBM are named only in the schema, and the progress-reporting remark references something the tool cannot be asked for, leaving a small ambiguity.

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?

Schema coverage is 100%, so baseline is 3, but the description genuinely compensates for the terse schema text 'The model, as text' by specifying LP syntax, spacing rules (no '*', '/', parentheses), bracketed quadratic terms, and default bounds. It does not add anything about 'sense' or 'format' beyond what the enum descriptions already say.

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 first sentence gives a specific verb and resource ('Solves a linear, quadratic or mixed-integer optimisation model') plus the returns ('solution state, objective value and each variable's value by name'). It does not explicitly distinguish itself from the siblings 'environment' or 'translate', but the domain is specific enough that an agent can select it without confusion.

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 implied by the domain: supply a model as text, LP format unless 'format' says otherwise. There is no explicit when-to-use / when-not-to-use statement and no routing to alternatives, so the guidance is adequate but not deliberate.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources