subtract
Calculate the difference between two numbers by subtracting one integer from another. Use this tool to perform basic arithmetic subtraction operations.
Instructions
Subtract two numbers
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
- main.py:15-17 (handler)The handler function that implements the subtract tool logic by subtracting two integers.
def subtract(a: int, b: int) -> int: """Subtract two numbers""" return a - b - main.py:14-14 (registration)Registers the subtract tool with the FastMCP instance using the @mcp.tool decorator.
@mcp.tool - main.py:15-15 (schema)Type annotations defining the input schema (two ints) and output (int) for the subtract tool.
def subtract(a: int, b: int) -> int: