sum_numbers
Calculate the sum of a list of integers. This tool from MCP Deployment adds multiple numbers together to provide a total.
Instructions
Returns the sum of a list of integers provided as input. Args: numbers (list[int]): A list of integers to be summed.
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": {
"numbers": "<numbers>"
},
"name": "sum_numbers"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| numbers | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- src/mcpserver/deployment.py:8-8 (registration)Registers the sum_numbers tool with the MCP server using the @mcp.tool decorator specifying the name.
@mcp.tool(name="sum_numbers") - src/mcpserver/deployment.py:9-15 (handler)The handler function for sum_numbers that takes a list of integers and returns their sum using Python's built-in sum().
def sum_numbers(numbers: list[int]) -> int: """ Returns the sum of a list of integers provided as input. Args: numbers (list[int]): A list of integers to be summed. """ return sum(numbers)