Skip to main content
Glama

mcp-optimizer

solve_integer_program_tool

Optimize discrete decision problems using integer or mixed-integer programming. Solve facility location, project selection, crew scheduling, network design, cutting stock, and capital budgeting with defined objectives, variables, and constraints.

Instructions

Solve an integer or mixed-integer programming problem using PuLP.

This tool solves optimization problems where some or all variables must take integer values, which is useful for discrete decision problems. Use cases: - Facility location: Decide where to build warehouses or service centers - Project selection: Choose which projects to fund (binary decisions) - Crew scheduling: Assign integer numbers of staff to shifts - Network design: Design networks with discrete components - Cutting stock: Minimize waste when cutting materials - Capital budgeting: Select investments when partial investments aren't allowed Args: objective: Objective function with 'sense' and 'coefficients' variables: Variable definitions with types "continuous", "integer", or "binary" constraints: List of linear constraints solver: Solver to use ("CBC", "GLPK", "GUROBI", "CPLEX") time_limit_seconds: Maximum time to spend solving (optional) Returns: Optimization result with integer/binary variable values Example: # Binary knapsack: select items to maximize value within weight limit solve_integer_program( objective={"sense": "maximize", "coefficients": {"item1": 10, "item2": 15}}, variables={ "item1": {"type": "binary"}, "item2": {"type": "binary"} }, constraints=[ {"expression": {"item1": 5, "item2": 8}, "operator": "<=", "rhs": 10} ] )

Input Schema

NameRequiredDescriptionDefault
constraintsYes
objectiveYes
solverNoCBC
time_limit_secondsNo
variablesYes

Input Schema (JSON Schema)

{ "properties": { "constraints": { "items": { "additionalProperties": true, "type": "object" }, "title": "Constraints", "type": "array" }, "objective": { "additionalProperties": true, "title": "Objective", "type": "object" }, "solver": { "default": "CBC", "title": "Solver", "type": "string" }, "time_limit_seconds": { "anyOf": [ { "type": "number" }, { "type": "null" } ], "default": null, "title": "Time Limit Seconds" }, "variables": { "additionalProperties": { "additionalProperties": true, "type": "object" }, "title": "Variables", "type": "object" } }, "required": [ "objective", "variables", "constraints" ], "type": "object" }

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/dmitryanchikov/mcp-optimizer'

If you have feedback or need assistance with the MCP directory API, please join our Discord server