Math & Numbers
Solve pressure, volume, temperature, or moles with the Ideal Gas Law (PV=nRT) or Combined Gas Law; also gas density and molar mass.
Call this tool from your code in three languages.
curl -X POST 'https://api.elysiatools.com/en/api/tools/gas-law-calculator' \
-H 'Content-Type: application/json' \
-d '{"mode":"ideal","runits":"L·atm/mol·K","tempUnit":"kelvin","pressure":1,"volume":"","temperature":273.15,"moles":1,"p1":0,"v1":0,"t1":0,"p2":0,"v2":0,"t2":0,"molarMass":0,"mass":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/gas-law-calculator| Name | Type | Required | Description |
|---|---|---|---|
| mode | select | No | — |
| runits | select | No | Determines the pressure/volume units you must enter. Temperature is always converted to Kelvin internally. |
| tempUnit | select | No | — |
| pressure | number | No | Leave blank to solve for pressure in Ideal mode. |
| volume | number | No | Leave blank to solve for volume in Ideal mode. |
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-gas-law-calculator": {
"name": "gas-law-calculator",
"description": "Solve pressure, volume, temperature, or moles with the Ideal Gas Law (PV=nRT) or Combined Gas Law; also gas density and molar mass.",
"baseUrl": "https://api.elysiatools.com/mcp/sse?toolId=gas-law-calculator",
"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": "gas-law-calculator",
"arguments": {
"mode": "ideal",
"runits": "L·atm/mol·K",
"tempUnit": "kelvin",
"pressure": 1,
"volume": "",
"temperature": 273.15,
"moles": 1,
"p1": 0,
"v1": 0,
"t1": 0,
"p2": 0,
"v2": 0,
"t2": 0,
"molarMass": 0,
"mass": 0,
"decimalPlaces": 4
}
}
}Questions or issues? Contact [email protected]
| temperature | number | No | Leave blank to solve for temperature in Ideal mode. |
| moles | number | No | Leave blank to solve for moles in Ideal mode. |
| p1 | number | No | — |
| v1 | number | No | — |
| t1 | number | No | — |
| p2 | number | No | — |
| v2 | number | No | — |
| t2 | number | No | — |
| molarMass | number | No | — |
| mass | number | No | — |
| decimalPlaces | number | No | — |
JSON result
{
"key": {...},
"metadata": {
"key": "value"
},
"error": "Error message (optional)",
"message": "Notification message (optional)"
}