sympy_ge
Construct a symbolic greater-than-or-equal inequality between two algebraic expressions.
Instructions
Create greater than or equal.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| lhs | Yes | Left-hand side | |
| rhs | Yes | Right-hand side |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- src/mcp_sympy/tools.py:1920-1935 (handler)The handler function that implements the 'sympy_ge' tool. It takes two string expressions (lhs, rhs), sympifies them, constructs a SymPy Ge (greater-than-or-equal) object, and returns its string representation.
@mcp.tool() def sympy_ge(lhs: str, rhs: str) -> str: """Create greater than or equal. Args: lhs: Left-hand side rhs: Right-hand side Returns: Greater than or equal as string Example: >>> sympy_ge("x", "y") "x >= y" """ return str(Ge(_sympify(lhs), _sympify(rhs))) - src/mcp_sympy/tools.py:1921-1921 (schema)The type signature defines the input schema: two string parameters (lhs, rhs) and a string return value.
def sympy_ge(lhs: str, rhs: str) -> str: - src/mcp_sympy/tools.py:1920-1920 (registration)The tool is registered via the @mcp.tool() decorator, which is the FastMCP framework's registration mechanism.
@mcp.tool() - src/mcp_sympy/tools.py:114-116 (helper)Supporting helper function _sympify used to convert string input into a SymPy expression object before comparison.
def _sympify(expr: str) -> sympy.Basic: """Convert string expression to SymPy object.""" return sympy.sympify(expr) - src/mcp_sympy/tools.py:16-16 (helper)The Ge (greater-than-or-equal) class is imported from sympy at the top of the file and used inside the handler.
Ge,