Skip to main content

convert_pressure

Converts a numeric pressure value from one unit to another. Supports SI (Pa, hPa, kPa, MPa), meteorological (bar, mbar), engineering (psi), and physical atmosphere / column units (atm, mmHg, torr, inHg).

Parameters​

ParameterTypeRequiredDescription
valuenumberYesNumeric value to convert.
fromstringYesSource unit: Pa, hPa, kPa, MPa, bar, mbar, psi, atm, mmHg, torr, inHg
tostringYesTarget unit: Pa, hPa, kPa, MPa, bar, mbar, psi, atm, mmHg, torr, inHg

Response​

FieldTypeDescription
resultnumberConverted value.

Example​

{
"value": 1,
"from": "atm",
"to": "Pa"
}

Result:

{
"result": 101325.0
}

More examples​

valuefromtoresult
1barkPa100.0
1psiPa6894.757...
760mmHgatm1.0
1013hPabar1.013

Errors​

Each failure carries a precise code in the response. Argument-schema and server errors are JSON-RPC protocol errors; a rejected value is returned as a tool result with isError: true (so the agent can read the code and self-correct).

CodeWhenDelivered as
invalid_argumentsvalue is missing or not a number, or from/to is missing or not a string.protocol error (invalid_params)
invalid_unitfrom or to is not a recognised unit. The error message lists the accepted unit strings.tool error (isError)
internal_errorAn unexpected server error.protocol error (internal_error)

Notes​

  • Unit strings are case-sensitive: Pa and pa are different (only Pa is accepted).
  • mmHg and torr share the same conversion factor (133.322 387 415 Pa) and are interchangeable.
  • hPa and mbar are numerically equivalent (both equal 100 Pa) but are distinct unit strings.
  • All results are 64-bit floating-point numbers.