add
Add two integers to calculate their sum. This mathematical tool performs basic addition for numerical calculations.
Instructions
Add 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": "add"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| a | Yes | ||
| b | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- src/mcpserver/deployment.py:9-11 (handler)The 'add' tool handler function that takes two integers and returns their sum.
def add(a: int, b: int) -> int: """Add two numbers""" return a + b - src/mcpserver/deployment.py:8-8 (registration)Registers the 'add' tool using the @mcp.tool() decorator.
@mcp.tool()