add
Compute the sum of two numbers. Provide two numeric inputs to perform addition.
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
- calculator_server/server.py:182-184 (handler)The 'add' tool handler function that adds two numbers. Decorated with @mcp.tool() and returns the sum of a and b.
def add(a: float, b: float) -> float: """Add two numbers""" return a + b - calculator_server/server.py:181-181 (registration)The @mcp.tool() decorator that registers the add function as an MCP tool.
@mcp.tool()