calculate_percentage
Calculate a percentage of any given value using this mathematical tool. Input the base value and percentage to get the calculated result.
Instructions
Calculate a percentage of a value.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| percentage | Yes | ||
| value | Yes |
Implementation Reference
- server.py:116-119 (handler)The main handler function for the 'calculate_percentage' tool. It is decorated with @mcp.tool(), which registers it in the MCP server. The function computes the specified percentage of the given value using the formula (value * percentage) / 100.@mcp.tool() def calculate_percentage(value: float, percentage: float) -> float: """Calculate a percentage of a value.""" return (value * percentage) / 100