Skip to main content
Glama
Symbolic Algebra MCP Server

Symbolic Algebra MCP Server

solve_inequality

Solves a previously introduced inequality in one real variable over the reals and returns the solution set as a LaTeX string.

Instructions

Solves an inequality in one real variable using SymPy's solveset over the reals.

The inequality is introduced with introduce_expression, e.g. "x**2 - 1 > 0",
"(x - 1)/(x + 2) <= 0", or a combination "And(x > 0, x**2 < 4)" / "Or(...)".
For a double inequality a < f(x) < b use "And(a < f(x), f(x) < b)".

Args:
    expr_key: The key of the inequality (previously introduced).
    var_name: The variable (previously introduced) to solve for.

Example:
    intro("x", [Assumption.REAL], [])
    expr_key = introduce_expression("x**2 - 1 > 0")
    solve_inequality(expr_key, "x")
    # \left(-\infty, -1\right) \cup \left(1, \infty\right)

Returns:
    A LaTeX string representing the solution set. Returns an error message string if issues occur.

Input Schema

NameRequiredDescriptionDefault
expr_keyYes
var_nameYes

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.2/5.0
Behavior4/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 discloses that solving is over the reals via solveset, that the result is a LaTeX string, and that errors return a message string; it does not explicitly state read-only behavior or what happens if the expression or variable was not introduced.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with the purpose, then structured with Args, Example, and Returns sections. Each part adds useful information for correct invocation without unnecessary repetition.

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

Completeness5/5

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

Given the lack of annotations, 0% schema description coverage, and an output schema, the description is complete enough: it explains prerequisites, both parameters, inequality encoding including double inequalities, an example, return format, and error behavior.

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 description coverage is 0%, so the description must explain both parameters. It defines expr_key as the key of a previously introduced inequality and var_name as the previously introduced variable to solve for, and the example demonstrates their use.

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 description states a specific verb and resource: solve an inequality in one real variable using SymPy's solveset over the reals. It is clear what the tool does, but it does not explicitly distinguish itself from sibling tools such as solve_algebraically.

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

Usage Guidelines4/5

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

The description gives clear prerequisite context: the inequality must first be introduced with introduce_expression, and double inequalities must be encoded with And. It does not state when to use this tool versus alternatives like solve_algebraically or solve_nonlinear_system, so it lacks explicit exclusions or alternative routing.

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