sympy_Circle
Define a circle symbolically by specifying its center point and radius.
Instructions
Create a circle.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| center | Yes | Center point | |
| radius | Yes | Radius |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- src/mcp_sympy/tools.py:2132-2147 (handler)The main handler function for the sympy_Circle tool. It takes a center point string and radius string, converts them to SymPy objects via _sympify, constructs a Circle object, and returns its string representation.
@mcp.tool() def sympy_Circle(center: str, radius: str) -> str: """Create a circle. Args: center: Center point radius: Radius Returns: Circle as string Example: >>> sympy_Circle("(0, 0)", "1") "Circle(Point2D(0, 0), 1)" """ return str(Circle(_sympify(center), _sympify(radius))) - src/mcp_sympy/tools.py:2132-2132 (registration)The @mcp.tool() decorator registers sympy_Circle as a tool in the MCP server (mcp = fastmcp.FastMCP('mcp-sympy')).
@mcp.tool() - src/mcp_sympy/tools.py:114-116 (helper)The _sympify helper function used to convert the string inputs (center and radius) into SymPy objects before constructing the Circle.
def _sympify(expr: str) -> sympy.Basic: """Convert string expression to SymPy object.""" return sympy.sympify(expr) - src/mcp_sympy/tools.py:2133-2133 (schema)Type annotations define the input schema: center (str) and radius (str), returning a string representation.
def sympy_Circle(center: str, radius: str) -> str: