convert_area
Converts a numeric area value from one unit to another. Supports metric (mm² through km²), imperial (in², ft², yd²), and land-area units (acre, ha).
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
value | number | Yes | Numeric value to convert. |
from | string | Yes | Source unit: mm2, cm2, m2, km2, in2, ft2, yd2, acre, ha |
to | string | Yes | Target unit: mm2, cm2, m2, km2, in2, ft2, yd2, acre, ha |
Response
| Field | Type | Description |
|---|---|---|
result | number | Converted value. |
Example
{
"value": 1,
"from": "ha",
"to": "m2"
}
Result:
{
"result": 10000.0
}
More examples
value | from | to | result |
|---|---|---|---|
1 | km2 | ha | 100.0 |
1 | acre | m2 | 4046.8564224 |
1 | ft2 | m2 | 0.09290304 |
640 | acre | km2 | 2.589988... |
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 suffixes use
2to denote squared (e.g.m2= m²,ft2= ft²). hais the hectare (10 000 m²);acreis the international acre (≈ 4 046.856 m²).- All results are 64-bit floating-point numbers.