add
Add two integers to compute their sum. Provide integer inputs a and b to receive the result.
Instructions
Return the sum of two integers.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| a | Yes | ||
| b | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- src/mcp_server_starter/server.py:14-17 (handler)The 'add' tool implementation. Decorated with @mcp.tool(), it takes two integers a and b and returns their sum.
@mcp.tool() def add(a: int, b: int) -> int: """Return the sum of two integers.""" return a + b - src/mcp_server_starter/server.py:14-14 (registration)Registration of the 'add' tool via the @mcp.tool() decorator on the FastMCP instance.
@mcp.tool() - Type-annotated signature defining the input schema (a: int, b: int) and output type (int) for the add tool.
def add(a: int, b: int) -> int: