add
Add two numbers together to calculate their sum. This tool performs basic addition for mathematical calculations.
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 |
Implementation Reference
- server.py:73-76 (handler)The 'add' tool handler function that adds two floating-point numbers. It is registered using the @mcp.tool() decorator, with input schema defined by the type hints (a: float, b: float) and output float.
@mcp.tool() def add(a: float, b: float) -> float: """Add two numbers together.""" return a + b