Elysia Tools Docs
EN
Language
ZHESPTRUFRDEEN
Back to site
Browse tools

Math & Numbers

Gas Law Calculator

Solve pressure, volume, temperature, or moles with the Ideal Gas Law (PV=nRT) or Combined Gas Law; also gas density and molar mass.

json· JSON resultOpen tool

Quick start

Call this tool from your code in three languages.

cURL
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}'

API reference

Send a POST request with your inputs as JSON. File parameters require a separate upload first.

Endpoint

HTTP
POST https://api.elysiatools.com/en/api/tools/gas-law-calculator

Parameters

NameTypeRequiredDescription
modeselectNo—
runitsselectNoDetermines the pressure/volume units you must enter. Temperature is always converted to Kelvin internally.
tempUnitselectNo—
pressurenumberNoLeave blank to solve for pressure in Ideal mode.
volumenumberNoLeave blank to solve for volume in Ideal mode.

MCP integration

Add this tool to your Model Context Protocol server so AI agents can list and call it.

Server configuration

Add this block to your MCP client configuration:

mcp.json
{
  "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"
    }
  }
}

List available tools

After connecting to the SSE endpoint, list the exposed tools:

tools/list
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/list"
}

Call this tool

Invoke the tool by its id, passing arguments built from its parameters:

tools/call
{
  "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
}
  }
}
Chain multiple tools in one session with a comma-separated toolId list, e.g. /mcp/sse?toolId=png-to-webp,jpg-to-webp,gif-to-webp (max 20).

Questions or issues? Contact [email protected]

Browse toolsOpen tool

© 2026 Elysia Tools. Developer documentation.

Back to siteBrowse tools
temperaturenumberNoLeave blank to solve for temperature in Ideal mode.
molesnumberNoLeave blank to solve for moles in Ideal mode.
p1numberNo—
v1numberNo—
t1numberNo—
p2numberNo—
v2numberNo—
t2numberNo—
molarMassnumberNo—
massnumberNo—
decimalPlacesnumberNo—

Response format

JSON result

JSON
{
  "key": {...},
  "metadata": {
    "key": "value"
  },
  "error": "Error message (optional)",
  "message": "Notification message (optional)"
}