add
Add two integers together to calculate their sum using this mathematical tool from the MCP Boilerplate Server.
Instructions
Add two numbers together
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
- mcp_server_boilerplate/server.py:12-15 (handler)The handler function for the 'add' tool. It is decorated with @mcp.tool, which registers it in the MCP server. Takes two integers a and b, adds them, and returns the result. Input schema inferred from type annotations (a: int, b: int), output: int, docstring provides description.
@mcp.tool def add(a: int, b: int) -> int: """Add two numbers together""" return a + b