subtract
Calculate the difference by subtracting the second number from the first.
Instructions
Subtract b from a
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_server/server.py:186-189 (handler)The subtract tool handler function. Registered with @mcp.tool() decorator, takes two floats (a, b) and returns a - b.
@mcp.tool() def subtract(a: float, b: float) -> float: """Subtract b from a""" return a - b - calculator_server/server.py:186-186 (registration)The @mcp.tool() decorator on line 186 registers the subtract function as an MCP tool.
@mcp.tool()