calculate_percentage
Calculate a percentage of a value by providing the base number and percentage to compute. This tool performs the mathematical operation to determine the percentage amount.
Instructions
Calculate a percentage of a value.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| value | Yes | ||
| percentage | Yes |
Implementation Reference
- server.py:116-119 (handler)The handler function for the 'calculate_percentage' tool, decorated with @mcp.tool() for registration in the MCP server. It calculates (value * percentage) / 100.@mcp.tool() def calculate_percentage(value: float, percentage: float) -> float: """Calculate a percentage of a value.""" return (value * percentage) / 100