Convert between pt, dp and px
convert_unitsConverts lengths on one device between its layout unit (pt on iOS, dp on Android) and physical pixels (px), at the device's measured scale or density. For dp to px on Android it also gives the whole pixel Compose's Dp.roundToPx() returns.
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": {
"device": "<device>",
"values": "<values>",
"from": "<from>",
"to": "<to>"
},
"name": "convert_units"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | Yes | ||
| from | Yes | ||
| device | Yes | A device id from list_devices, such as iphone-17 or pixel-8. | |
| values | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| unit | Yes | ||
| device | Yes | ||
| values | Yes | ||
| dataset | Yes | ||
| pixelsPerUnit | Yes |