calculate_percentage
Calculate the value of a percentage of a total, the percentage change between two values, or what percent one value is of another.
Instructions
Perform one of three percentage operations selected by operation: the value of a percent of a total, the percentage change between two values, or what percent one value is of another. Inputs: operation (see enum), a and b (the two operands — their meaning depends on the operation, as described in the parameter docs). Returns the numeric result with the applied formula. Read-only and deterministic.
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": {
"operation": "<operation>",
"a": "<a>",
"b": "<b>"
},
"name": "calculate_percentage"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| a | Yes | First value | |
| b | Yes | Second value | |
| operation | Yes | of: X% of Y; change: from A to B; what_pct: X is what % of Y |