Skip to main content
Glama

run_solver

Run constrained optimization on Excel cell references: adjust variable cells to minimize or maximize an objective expression, with optional constraints and bounds.

Instructions

Run constrained optimisation using scipy to minimise (or maximise) an objective built from cell references.

Args: file_path: Workbook path. sheet_name: Worksheet providing objective or referenced cells. objective_expression: Arithmetic expression using cell refs (e.g. "B2 * B3 - B4"). variable_cells: Mapping of cell_ref to bounds, e.g. {"B2": {"lower": 0, "upper": 100}}. constraints: Optional list of solver constraints, each with 'expression' and 'type' ('ineq' or 'eq'). maximize: If True, the objective is maximised instead of minimised. tolerance: Convergence tolerance. max_iterations: Maximum solver iterations.

Returns: SolverResult: Contains solution, status, and diagnostics.

Notes: - May write back solution values into the workbook depending on implementation — document write semantics.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
maximizeNo
file_pathYes
toleranceNo
sheet_nameYes
constraintsNo
max_iterationsNo
variable_cellsYes
objective_expressionYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
messageYes
convergedYes
iterationsYes
found_valuesYes
objective_valueYes
Behavior2/5

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

Annotations are absent, so the description carries the full burden of disclosing side effects. The Notes section says 'May write back solution values into the workbook depending on implementation', which is vague and fails to state definitive behavior, reversibility, or permission requirements. The phrase 'document write semantics' is an instruction rather than an actual disclosure.

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 clear Args, Returns, and Notes sections, front-loaded with the core purpose. It avoids unnecessary prose and each bullet earns its place. The only minor issue is the meta-instruction in Notes ('document write semantics'), which is slightly awkward but not harmful.

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?

For an 8-parameter tool with nested objects and no annotations, the description covers the core workflow and all parameters. However, it leaves gaps around constraint semantics (e.g., whether 'ineq' means >=0), the exact write-back behavior, and details of the SolverResult fields. An output schema may cover some of this, but the write-back ambiguity is a significant omission.

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

Parameters5/5

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

Schema description coverage is 0%, so the description must compensate for all parameter meanings. The Args section does so thoroughly, listing all eight parameters with plain-language explanations and concrete examples for complex ones such as objective_expression ('B2 * B3 - B4') and variable_cells (mapping with bounds). Tolerance and max_iterations are explained just enough given their self-explanatory names.

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 begins with a specific verb and resource: 'Run constrained optimisation using scipy to minimise (or maximise) an objective built from cell references.' This clearly states what the tool does and differentiates it from sibling tools like goal_seek or run_regression. The inclusion of 'constrained optimisation' and 'cell references' gives a precise scope.

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

Usage Guidelines2/5

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

No guidance is provided on when to use this tool versus alternatives such as goal_seek or other solver/analysis tools. It lacks any 'use when'/'do not use' statements, prerequisites, or explicit exclusions. The description only explains parameters and leaves usage context entirely implicit.

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/mbeps/excel-mcp'

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