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
| Parameter | Type | Required | Description |
|---|---|---|---|
value | number | Yes | Numeric value to convert. |
from | string | Yes | Source unit: Pa, hPa, kPa, MPa, bar, mbar, psi, atm, mmHg, torr, inHg |
to | string | Yes | Target unit: Pa, hPa, kPa, MPa, bar, mbar, psi, atm, mmHg, torr, inHg |
Response
| Field | Type | Description |
|---|---|---|
result | number | Converted value. |
Example
{
"value": 1,
"from": "atm",
"to": "Pa"
}
Result:
{
"result": 101325.0
}
More examples
value | from | to | result |
|---|---|---|---|
1 | bar | kPa | 100.0 |
1 | psi | Pa | 6894.757... |
760 | mmHg | atm | 1.0 |
1013 | hPa | bar | 1.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).
| Code | When | Delivered as |
|---|---|---|
invalid_arguments | value is missing or not a number, or from/to is missing or not a string. | protocol error (invalid_params) |
invalid_unit | from or to is not a recognised unit. The error message lists the accepted unit strings. | tool error (isError) |
internal_error | An unexpected server error. | protocol error (internal_error) |
Notes
- Unit strings are case-sensitive:
Paandpaare different (onlyPais accepted). mmHgandtorrshare the same conversion factor (133.322 387 415 Pa) and are interchangeable.hPaandmbarare numerically equivalent (both equal 100 Pa) but are distinct unit strings.- All results are 64-bit floating-point numbers.