add
Calculate the sum of two integers by providing both numbers as input parameters to perform basic addition.
Instructions
Add two integers together.
Args: a: First integer b: Second integer
Returns: The sum of a and b
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| a | Yes | ||
| b | Yes |
Implementation Reference
- main.py:6-16 (handler)The handler function that executes the 'add' tool logic. Takes two integers (a, b) as input and returns their sum. Type hints and docstring provide the schema for input/output validation.
def add(a: int, b: int) -> int: """Add two integers together. Args: a: First integer b: Second integer Returns: The sum of a and b """ return a + b - main.py:5-5 (registration)The @mcp.tool decorator registers the 'add' function as an MCP tool with the FastMCP server instance.
@mcp.tool - main.py:6-15 (schema)Input/output schema defined through Python type hints (a: int, b: int -> int) and comprehensive docstring documenting the parameters and return value.
def add(a: int, b: int) -> int: """Add two integers together. Args: a: First integer b: Second integer Returns: The sum of a and b """