eval_expression
Compute advanced mathematical operations by evaluating PARI/GP expressions. Supports factorization, primality testing, polynomial root finding, and elliptic curve calculations.
Instructions
Evaluate a PARI/GP expression string.
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": "eval_expression"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| expr | Yes | A PARI/GP expression as a string (e.g., "x^2 + 1", "factor(100)", "prime(10)"). For multiple computations, ALWAYS use vector expressions like "vector(15, n, qfbclassno(-4*n))" instead of for-loops with print statements. For-loops may cause timeouts. | |
| timeout | No | Maximum execution time in seconds (default 60). Note: This is a best-effort timeout and may not work reliably for long-running PARI operations written in C. |