sum
Add two integers together to calculate their total. This tool performs basic arithmetic addition for numerical values.
Instructions
Suma dos números.
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": "sum"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| a | Yes | ||
| b | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- server.py:13-16 (registration)The sum tool is registered using the @mcp.tool() decorator, which exposes the function as an MCP tool.
@mcp.tool() def sum(a: int, b: int) -> int: """Suma dos números.""" return a + b - server.py:14-16 (handler)The sum handler function that takes two integer parameters (a, b) and returns their sum. The function signature also serves as the schema definition.
def sum(a: int, b: int) -> int: """Suma dos números.""" return a + b