sympy_satisfiable
Check if a Boolean expression is satisfiable by determining whether there exists an assignment of variables that makes it true.
Instructions
Check if expression is satisfiable.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| expr | Yes | Boolean expression |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- src/mcp_sympy/tools.py:2058-2072 (handler)The tool handler function `sympy_satisfiable` that checks if a boolean expression is satisfiable using SymPy's `satisfiable()` function.
@mcp.tool() def sympy_satisfiable(expr: str) -> str: """Check if expression is satisfiable. Args: expr: Boolean expression Returns: Solution or False Example: >>> sympy_satisfiable("x & y") "{x: True, y: True}" """ return str(satisfiable(_sympify(expr))) - src/mcp_sympy/tools.py:2058-2072 (schema)The function signature defines the schema: takes a single string `expr` (the boolean expression) and returns a string (the solution or 'False').
@mcp.tool() def sympy_satisfiable(expr: str) -> str: """Check if expression is satisfiable. Args: expr: Boolean expression Returns: Solution or False Example: >>> sympy_satisfiable("x & y") "{x: True, y: True}" """ return str(satisfiable(_sympify(expr))) - src/mcp_sympy/tools.py:2058-2058 (registration)The `@mcp.tool()` decorator registers this function as an MCP tool named 'sympy_satisfiable'.
@mcp.tool() - src/mcp_sympy/tools.py:114-116 (helper)The `_sympify` helper function converts a string expression to a SymPy object, used by the handler.
def _sympify(expr: str) -> sympy.Basic: """Convert string expression to SymPy object.""" return sympy.sympify(expr) - src/mcp_sympy/tools.py:95-95 (helper)Import of `satisfiable` from SymPy, which is the underlying function called by the handler.
satisfiable,