add_numbers
Add two integers to calculate their sum. This tool performs basic arithmetic addition for mathematical operations.
Instructions
Add two integers and return the result.
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_numbers"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| a | Yes | ||
| b | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- server.py:9-12 (handler)The implementation of the 'add_numbers' tool. The @mcp.tool() decorator registers it with the MCP server, the function signature defines the input/output schema (two int inputs, int output), and the body executes the logic: returns a + b + 3.
@mcp.tool() def add_numbers(a: int, b: int) -> int: """Add two integers and return the result.""" return a + b + 3