Skip to main content
Glama
bob-cplex-mcp

bob-cplex-mcp

by doubladeeeer

Solve Linear Program Tool

solve_linear_program_tool

Solve linear and mixed-integer programs by defining objectives, variables, and constraints to optimize resource allocation, production, diets, investments, or logistics.

Instructions

Solve a linear programming problem using PuLP.

This tool solves general linear programming problems where you want to optimize a linear objective function subject to linear constraints.

Use cases:

  • Resource allocation: Distribute limited resources optimally

  • Diet planning: Create nutritionally balanced meal plans within budget

  • Manufacturing mix: Determine optimal product mix to maximize profit

  • Investment planning: Allocate capital across different investment options

  • Supply chain optimization: Minimize transportation and storage costs

  • Energy optimization: Optimize power generation and distribution

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": {
      "objective": "<objective>",
      "variables": "<variables>",
      "constraints": "<constraints>"
    },
    "name": "solve_linear_program_tool"
  }
}

Input Schema

NameRequiredDescriptionDefault
solverNoSolver to use ("CBC", "GLPK", "GUROBI", "CPLEX"); the requested solver must be available or the call fails - no silent fallbackCPLEX
objectiveYesObjective function with 'sense' ("minimize" or "maximize") and 'coefficients' (dict mapping variable names to coefficients)
variablesYesVariable definitions mapping variable names to their properties (type: "continuous"/"integer"/"binary", lower: bound, upper: bound)
constraintsYesList of constraints, each with 'expression' (coefficients), 'operator' ("<=", ">=", "=="), and 'rhs' (right-hand side value)
time_limit_secondsNoMaximum time to spend solving (optional)

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.2/5.0
Behavior2/5

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

No annotations are provided, so the description carries the full behavioral burden. It says nothing about what happens with infeasible or unbounded problems, whether the requested solver must be installed (that crucial detail lives only in the schema), how time limits behave, or that the operation is a non-destructive computation. 'Using PuLP' is the only implementation hint.

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 well front-loaded and earn their place. The six-bullet use-case catalog is generic domain advertising that does not help an agent decide or invoke; it inflates length without adding operational value.

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?

Output schema exists, so return values need not be explained, and the nested parameter structures are fully documented in the schema. What remains missing is sibling differentiation versus solve_integer_program_tool and failure-mode behavior (infeasibility, unavailable solver), which are meaningful gaps for a modeling tool.

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%, so the input schema already documents objective, variables, constraints, solver, and time_limit_seconds in detail. The description adds no syntax, format, or constraint on any parameter, which is the baseline 3 when the schema does the heavy lifting.

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?

States a specific verb and resource: 'Solve a linear programming problem using PuLP', and clarifies it covers general LPs with a linear objective and linear constraints. It never distinguishes itself from the sibling solve_integer_program_tool, and the mention of integer/binary variable types in the schema muddies the LP-vs-ILP 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?

The six use-case bullets imply applicability domains (resource allocation, diet planning, manufacturing mix, etc.), which gives an agent a sense of fit. However, there is no 'when not to use' guidance, no direction to the integer-programming sibling for discrete variables, and no prerequisites such as required solver availability.

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