sympy_ne
Construct a symbolic inequality representing not equal between two mathematical expressions.
Instructions
Create inequality (not 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:1848-1863 (handler)The handler for the 'sympy_ne' tool. Decorated with @mcp.tool(), it creates a SymPy Ne (not equal) expression from two string inputs using _sympify() and returns it as a string.
@mcp.tool() def sympy_ne(lhs: str, rhs: str) -> str: """Create inequality (not equal). Args: lhs: Left-hand side rhs: Right-hand side Returns: Neq as string Example: >>> sympy_ne("x", "y") "Ne(x, y)" """ return str(Ne(_sympify(lhs), _sympify(rhs))) - src/mcp_sympy/tools.py:114-116 (schema)The _sympify helper function converts string expressions to SymPy objects, used by sympy_ne to parse input.
def _sympify(expr: str) -> sympy.Basic: """Convert string expression to SymPy object.""" return sympy.sympify(expr) - src/mcp_sympy/tools.py:29-29 (helper)The Ne symbol is imported from sympy at line 29, the core 'Not Equal' class used by sympy_ne.
Ne, - src/mcp_sympy/tools.py:1848-1848 (registration)The @mcp.tool() decorator registers sympy_ne as an MCP tool with the FastMCP server (mcp-sympy).
@mcp.tool()