add
Calculate the sum of two numeric values. Provide two numbers to get their total.
Instructions
Sum two numbers.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| a | Yes | ||
| b | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- The 'add' tool handler: sums two float numbers. Registered via @mcp.tool() decorator at line 79.
@mcp.tool() def add(a: float, b: float) -> float: """Sum two numbers.""" return a + b - src/mcp_research_collective/mcp_server.py:79-82 (registration)The @mcp.tool() decorator on line 79 registers the 'add' function as an MCP tool named 'add' on the FastMCP instance.
@mcp.tool() def add(a: float, b: float) -> float: """Sum two numbers.""" return a + b - Input schema: 'a' (float), 'b' (float). Return type: float. The function signature serves as the schema definition via FastMCP introspection.
@mcp.tool() def add(a: float, b: float) -> float: """Sum two numbers.""" return a + b