Skip to main content
Glama
Sharmarajnish

Constrained Optimization MCP Server

solve_convex_optimization

Specify variables, objective expression, and constraints to solve convex optimization problems such as linear, quadratic, or semidefinite programming.

Instructions

Solve convex optimization problems using CVXPY.

This tool is ideal for mathematical optimization problems with convex objectives
and constraints, including linear programming, quadratic programming, and
semidefinite programming.

Args:
    variables: List of variable definitions with 'name' and 'shape'
    objective_type: Either 'minimize' or 'maximize'
    objective_expr: The objective function expression as a string
    constraints: List of constraint expressions as strings
    parameters: Dictionary of parameter values (e.g., matrices A, b)
    description: Optional problem description
    
Returns:
    Solution results including variable values and objective value
    
Example:
    variables = [{"name": "x", "shape": 2}]
    objective_type = "minimize"
    objective_expr = "cp.sum_squares(x)"
    constraints = ["x >= 0", "cp.sum(x) == 1"]

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
variablesYes
objective_typeYes
objective_exprYes
constraintsYes
parametersNo
descriptionNo
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 burden. It briefly mentions CVXPY but does not disclose behavioral traits such as side effects, authorization needs, or performance characteristics. The description is minimal in this regard.

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?

The description is well-structured with a one-liner, a clarifying paragraph, parameter documentation, return info, and an example. It is front-loaded and each part serves a purpose, though the example could be more integrated.

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

Completeness3/5

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

Given the absence of an output schema and annotations, the description covers input parameters well but falls short on return value details (only 'solution results including variable values and objective value'). The example helps, but more specifics on result structure are needed.

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 input schema has 0% description coverage, but the tool description includes a detailed parameter list with explanations (e.g., 'variables: List of variable definitions with name and shape') and an example. This adds significant meaning beyond the schema, though some details (e.g., shape format) could be clearer.

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 clearly states that the tool solves convex optimization problems using CVXPY, and lists specific problem types (linear, quadratic, semidefinite programming). This distinguishes it from sibling tools like solve_constraint_satisfaction.

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 description says it is 'ideal for convex optimization problems' which implies usage context, but it does not explicitly state when not to use it or mention alternative sibling tools. There is no direct guidance on choosing among similar tools.

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

Install Server

Other Tools

Latest Blog Posts

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/Sharmarajnish/MCP-Constrained-Optimization'

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