convert_units
Convert a value between physical units (e.g., distance, velocity, parallax) using validated conversions and rejecting mismatches.
Instructions
Convert a value between physical units with astropy's tested conversions.
Example: convert a parallax in mas, a distance in pc to ly, a velocity in km/s. Returns the converted value tagged with its new unit. Rejects unit mismatches.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"value": "<value>",
"from_unit": "<from_unit>",
"to_unit": "<to_unit>"
},
"name": "convert_units"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| value | Yes | ||
| to_unit | Yes | ||
| from_unit | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| unit | Yes | ||
| error | No | ||
| value | Yes |