percentage-calculator
Calculate percentages three ways: what's X% of Y, what % is X of Y, and what's the % change from X to Y. Use mode='of' for the first form, mode='ratio' for the second, mode='change' for the third.
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": {
"mode": "<mode>",
"a": "<a>",
"b": "<b>"
},
"name": "percentage-calculator"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| a | Yes | First number. Meaning depends on mode (see description). | |
| b | Yes | Second number. Meaning depends on mode. | |
| mode | Yes | Which percentage operation. 'of' = X% of Y, 'ratio' = X is what % of Y, 'change' = % change from X to Y. | |
| precision | No | Decimal places in the result. Defaults to 2. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes | Calculated result. | |
| formula | Yes | Formula used to compute the result. | |
| explanation | Yes | Human-readable description of what was computed. |