multiply
Calculate the product of two integers. Multiply two numbers together to get their total result.
Instructions
Multiply two integers together.
Args: a: First integer b: Second integer
Returns: The product of a and b
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| a | Yes | ||
| b | Yes |
Implementation Reference
- main.py:31-42 (handler)The multiply tool handler implementation, decorated with @mcp.tool to register it as an MCP tool. Takes two integer parameters (a and b) and returns their product. The function includes comprehensive docstring documentation for the tool schema.
@mcp.tool def multiply(a: int, b: int) -> int: """Multiply two integers together. Args: a: First integer b: Second integer Returns: The product of a and b """ return a * b - main.py:31-42 (registration)Registration of the multiply tool using FastMCP's @mcp.tool decorator on line 31. This decorator automatically registers the function as an MCP tool with its schema derived from the function signature and docstring.
@mcp.tool def multiply(a: int, b: int) -> int: """Multiply two integers together. Args: a: First integer b: Second integer Returns: The product of a and b """ return a * b - main.py:32-41 (schema)Schema definition for the multiply tool: accepts two integer parameters (a and b) and returns an integer. The type hints and docstring define the input/output schema for MCP tool validation.
def multiply(a: int, b: int) -> int: """Multiply two integers together. Args: a: First integer b: Second integer Returns: The product of a and b """