Math & Numbers
Calculate the elastic potential energy and force of a spring in compression or extension. U = ½·k·x², F = k·x. Solve energy from displacement, or displacement from energy.
Call this tool from your code in three languages.
curl -X POST 'https://api.elysiatools.com/en/api/tools/spring-compression-energy' \
-H 'Content-Type: application/json' \
-d '{"mode":"energy","k":10,"x":20,"U":0,"decimalPlaces":4}'Send a POST request with your inputs as JSON. File parameters require a separate upload first.
POST https://api.elysiatools.com/en/api/tools/spring-compression-energy| Name | Type | Required | Description |
|---|---|---|---|
| mode | select | No | — |
| k | number | Yes | — |
| x | number | No | Spring displacement (compression or extension). Required in Energy mode. |
| U | number | No | Target stored energy. Required in Displacement mode. |
| decimalPlaces | number | No | — |
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-spring-compression-energy": {
"name": "spring-compression-energy",
"description": "Calculate the elastic potential energy and force of a spring in compression or extension. U = ½·k·x², F = k·x. Solve energy from displacement, or displacement from energy.",
"baseUrl": "https://api.elysiatools.com/mcp/sse?toolId=spring-compression-energy",
"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": "spring-compression-energy",
"arguments": {
"mode": "energy",
"k": 10,
"x": 20,
"U": 0,
"decimalPlaces": 4
}
}
}Questions or issues? Contact [email protected]
JSON result
{
"key": {...},
"metadata": {
"key": "value"
},
"error": "Error message (optional)",
"message": "Notification message (optional)"
}