Math & Numbers
Composite trapezoidal rule for ∫f(x)dx: node table, integral estimate, optional exact value and O(h²) error report.
Call this tool from your code in three languages.
curl -X POST 'http://127.0.0.1:3003/en/api/tools/numerical-integration-trapezoid' \
-H 'Content-Type: application/json' \
-d '{"fx":"x^2","a":0,"b":1,"n":4,"exactF":"x^3/3","decimalPlaces":6}'Send a POST request with your inputs as JSON. File parameters require a separate upload first.
POST http://127.0.0.1:3003/en/api/tools/numerical-integration-trapezoid| Name | Type | Required | Description |
|---|---|---|---|
| fx | text | Yes | Integrand in x (functions: sin, cos, exp, ln, sqrt, …). |
| a | number | Yes | — |
| b | number | Yes | May be less than a (the integral flips sign, as in calculus). |
| n | number | Yes | h = (b − a)/n. More subintervals → smaller error, O(h²) globally. |
| exactF | text | No | Exact antiderivative in x; the tool reports F(b) − F(a) and the absolute error. Leave empty to skip. |
Add this tool to your Model Context Protocol server so AI agents can list and call it.
Add this block to your MCP client configuration:
{
"mcpServers": {
"elysiatools-numerical-integration-trapezoid": {
"name": "numerical-integration-trapezoid",
"description": "Composite trapezoidal rule for ∫f(x)dx: node table, integral estimate, optional exact value and O(h²) error report.",
"baseUrl": "http://127.0.0.1:3003/mcp/sse?toolId=numerical-integration-trapezoid",
"command": "",
"args": [],
"env": {},
"isActive": true,
"type": "sse"
}
}
}After connecting to the SSE endpoint, list the exposed tools:
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/list"
}Invoke the tool by its id, passing arguments built from its parameters:
{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/call",
"params": {
"name": "numerical-integration-trapezoid",
"arguments": {
"fx": "x^2",
"a": 0,
"b": 1,
"n": 4,
"exactF": "x^3/3",
"decimalPlaces": 6
}
}
}Questions or issues? Contact [email protected]
| decimalPlaces | number | No | — |
Text result
{
"result": "Processed text content",
"error": "Error message (optional)",
"message": "Notification message (optional)",
"metadata": {
"key": "value"
}
}