subtract
Calculate the difference between two numbers by subtracting one from another. Use this tool to perform floating-point subtraction operations for mathematical calculations.
Instructions
执行浮点数减法运算
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 |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- calculator.py:12-15 (handler)The handler function for the 'subtract' MCP tool. It is registered via the @mcp.tool() decorator and implements subtraction of two float numbers.
@mcp.tool() def subtract(a: float, b: float) -> float: """执行浮点数减法运算""" return a - b