sympy_cosh
Compute the hyperbolic cosine of symbolic expressions for mathematical analysis and calculus tasks.
Instructions
Hyperbolic cosine.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"expr": "<expr>"
},
"name": "sympy_cosh"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| expr | Yes | Expression |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- src/mcp_sympy/tools.py:1158-1172 (handler)The handler function for the sympy_cosh tool. Uses the @mcp.tool() decorator for registration, converts the input string to a SymPy object via _sympify, computes the hyperbolic cosine using sympy.cosh, and returns the result as a string.
@mcp.tool() def sympy_cosh(expr: str) -> str: """Hyperbolic cosine. Args: expr: Expression Returns: cosh(expr) as string Example: >>> sympy_cosh("0") "1" """ return str(cosh(_sympify(expr))) - src/mcp_sympy/tools.py:1159-1159 (schema)Type signature: accepts a string expression and returns a string result.
def sympy_cosh(expr: str) -> str: - src/mcp_sympy/tools.py:1158-1158 (registration)Registration of sympy_cosh as an MCP tool via the @mcp.tool() decorator on the FastMCP instance 'mcp'.
@mcp.tool() - src/mcp_sympy/tools.py:114-116 (helper)Helper function _sympify converts a string expression to a SymPy object, used by sympy_cosh.
def _sympify(expr: str) -> sympy.Basic: """Convert string expression to SymPy object.""" return sympy.sympify(expr) - src/mcp_sympy/tools.py:56-56 (helper)Import of sympy.cosh used in the sympy_cosh handler.
cosh,