add
Add two numbers together using this calculator tool. Enter values for A and B to perform floating-point addition and get the sum.
Instructions
执行浮点数加法运算
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| a | Yes | ||
| b | Yes |
Implementation Reference
- calculator.py:8-10 (handler)The handler function for the 'add' tool, which performs floating-point addition of two numbers.def add(a: float, b: float) -> float: """执行浮点数加法运算""" return a + b
- calculator.py:7-7 (registration)Registers the 'add' function as an MCP tool using the @mcp.tool() decorator.@mcp.tool()
- calculator.py:8-8 (schema)Type hints and docstring define the input schema: two float parameters 'a' and 'b', returning a float.def add(a: float, b: float) -> float: