plot_function
Plots y = f(x) from a mathematical expression over a specified x range and sample count, returning a PNG graph for visual analysis.
Instructions
Plots a graph of y = f(x).
Args: expression: The function expression as a string. start: The first x value to plot. end: The final x value to plot. step: The number of x samples to render.
Returns: On success: {"result": "Plot generated successfully.", "format": "png", ...} On error: {"error": }
Notes: - Use 'x' as the variable (e.g., x2, not x^2) - Multiplication must be explicitly indicated with * (e.g., 2*x, not 2x) - Powers can be represented with ** or ^ (e.g., x2 or x^2)
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": {
"expression": "<expression>"
},
"name": "plot_function"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| end | No | ||
| step | No | ||
| start | No | ||
| expression | Yes |