sympy_Line
Create a symbolic line by specifying two points. The tool computes the line equation using SymPy's symbolic mathematics.
Instructions
Create a line through two points.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| point1 | Yes | First point | |
| point2 | Yes | Second point |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- src/mcp_sympy/tools.py:2112-2129 (handler)The handler function for the sympy_Line tool. It takes two string point coordinates, sympifies them, and creates a SymPy Line object, returning its string representation.
@mcp.tool() def sympy_Line(point1: str, point2: str) -> str: """Create a line through two points. Args: point1: First point point2: Second point Returns: Line as string Example: >>> sympy_Line("(0, 0)", "(1, 1)") "Line2D(Point2D(0, 0), Point2D(1, 1))" """ p1 = _sympify(point1) p2 = _sympify(point2) return str(Line(p1, p2)) - src/mcp_sympy/tools.py:24-24 (schema)Import of Line from sympy, required for the Line constructor used in sympy_Line.
Line, - src/mcp_sympy/tools.py:119-119 (registration)The FastMCP instance (mcp) used to register the tool via the @mcp.tool() decorator.
mcp = fastmcp.FastMCP("mcp-sympy") - src/mcp_sympy/tools.py:114-116 (helper)The _sympify helper function that converts string expressions to SymPy objects, used by sympy_Line.
def _sympify(expr: str) -> sympy.Basic: """Convert string expression to SymPy object.""" return sympy.sympify(expr)