subtract
Calculate the difference between two integers by subtracting the second from the first. This mathematical tool provides subtraction functionality for numerical operations.
Instructions
Subtract the second integer from the first.
Args: a: First integer b: Second integer
Returns: The difference of a and b
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| a | Yes | ||
| b | Yes |
Implementation Reference
- main.py:18-29 (handler)The 'subtract' MCP tool handler implementation. This function is decorated with @mcp.tool which registers it as an MCP tool. It takes two integers (a and b) and returns their difference (a - b).
@mcp.tool def subtract(a: int, b: int) -> int: """Subtract the second integer from the first. Args: a: First integer b: Second integer Returns: The difference of a and b """ return a - b - main.py:18-18 (registration)The @mcp.tool decorator registers the subtract function as an MCP tool with the FastMCP server instance.
@mcp.tool - main.py:19-28 (schema)The function signature with type hints (a: int, b: int) -> int and docstring define the input/output schema for the subtract tool, including parameter descriptions and return value documentation.
def subtract(a: int, b: int) -> int: """Subtract the second integer from the first. Args: a: First integer b: Second integer Returns: The difference of a and b """