safe_divide
Divide two numbers precisely using Decimal arithmetic. Returns null instead of erroring on division by zero. Ideal for calculating ratios, rates, and per-unit costs.
Instructions
Divide two numbers with exact Decimal arithmetic. Returns null on divide-by-zero instead of erroring. Use for ratios, rates, per-unit costs.
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": {
"numerator": "<numerator>",
"denominator": "<denominator>"
},
"name": "safe_divide"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| numerator | Yes | The dividend. | |
| denominator | Yes | The divisor. | |
| decimal_places | No |