Skip to main content
Glama

subtract

Calculate the difference between two numbers by subtracting the second from the first. This mathematical tool performs subtraction operations to find numerical results.

Instructions

Subtract the second number from the first number. Args: a: The first number (minuend) b: The second number (subtrahend) Returns: The difference of a and b (a - b)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
aYes
bYes

Implementation Reference

  • server.py:41-53 (handler)
    The subtract tool handler function. It subtracts the second argument from the first and is registered as an MCP tool via the @mcp.tool() decorator. Input schema defined by type hints (a: float, b: float) and output float.
    @mcp.tool() def subtract(a: float, b: float) -> float: """ Subtract the second number from the first number. Args: a: The first number (minuend) b: The second number (subtrahend) Returns: The difference of a and b (a - b) """ return a - b

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/xiaoyuchenhot/MCP-example'

If you have feedback or need assistance with the MCP directory API, please join our Discord server