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.
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": "add"
}
}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: