add
Perform addition of two integers using the MCP Server Demo tool. Input values for a and b, and get the sum instantly, simplifying basic calculations for AI-assisted workflows.
Instructions
Add two numbers
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| a | Yes | ||
| b | Yes |
Implementation Reference
- server.py:108-111 (handler)The handler function for the 'add' tool, decorated with @mcp.tool() for registration. It takes two integers a and b, adds them, and returns the sum. The type hints serve as input schema, and the docstring provides description.@mcp.tool() def add(a: int, b: int) -> int: """Add two numbers""" return a + b