Skip to main content

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​

ParameterTypeRequiredDescription
valuenumberYesNumeric value to convert.
fromstringYesSource unit: mm2, cm2, m2, km2, in2, ft2, yd2, acre, ha
tostringYesTarget unit: mm2, cm2, m2, km2, in2, ft2, yd2, acre, ha

Response​

FieldTypeDescription
resultnumberConverted value.

Example​

{
"value": 1,
"from": "ha",
"to": "m2"
}

Result:

{
"result": 10000.0
}

More examples​

valuefromtoresult
1km2ha100.0
1acrem24046.8564224
1ft2m20.09290304
640acrekm22.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).

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 suffixes use 2 to denote squared (e.g. m2 = m², ft2 = ft²).
  • ha is the hectare (10 000 m²); acre is the international acre (≈ 4 046.856 m²).
  • All results are 64-bit floating-point numbers.