subtract
Calculate the difference between two numbers by subtracting the second value from the first. This mathematical operation tool provides accurate subtraction results for numeric inputs.
Instructions
Subtract the second number from the first number.
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": {
"a": "<a>",
"b": "<b>"
},
"name": "subtract"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| a | Yes | ||
| b | Yes |
Implementation Reference
- server.py:78-81 (handler)The subtract tool is implemented as a handler function using the @mcp.tool() decorator, which likely registers it with MCP. It takes two float arguments and returns their difference.
@mcp.tool() def subtract(a: float, b: float) -> float: """Subtract the second number from the first number.""" return a - b