add_two_numbers
Add two specified numbers together to calculate their sum. This tool is part of the MCP Server Deepdive, designed for straightforward numerical operations.
Instructions
Adds two numbers together.
Args:
a -- the first number
b -- the second number
Returns:
The sum of a and b
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| a | Yes | ||
| b | Yes |
Implementation Reference
- src/mcpserver/deeployment.py:5-16 (handler)The tool handler function for 'add_two_numbers', decorated with @mcp.tool() for registration, adds two input numbers and returns their sum. The docstring provides the schema information.@mcp.tool() def add_two_numbers(a, b): """ Adds two numbers together. Args: a -- the first number b -- the second number Returns: The sum of a and b """ return a + b
- src/mcpserver/deeployment.py:5-5 (registration)Registers the add_two_numbers tool using the FastMCP decorator.@mcp.tool()