add
Calculate the sum of two integer values. Enter two numbers to get their total result.
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 |
Implementation Reference
- server.py:108-111 (handler)The handler function for the 'add' tool, decorated with @mcp.tool() for registration in the MCP server. It takes two integers a and b, adds them, and returns the result. The type hints serve as the input schema.
@mcp.tool() def add(a: int, b: int) -> int: """Add two numbers""" return a + b