subtract
Calculate the difference by subtracting b from a, returning the result.
Instructions
Subtract b from a.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"a": "<a>",
"b": "<b>"
},
"name": "subtract"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| a | Yes | ||
| b | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- The subtract tool handler: decorated with @mcp.tool(), takes two floats a and b, returns a - b.
def subtract(a: float, b: float) -> float: """Subtract b from a.""" return a - b - src/mcp_research_collective/mcp_server.py:85-85 (registration)The @mcp.tool() decorator on line 85 registers subtract as an MCP tool on the FastMCP server instance.
@mcp.tool()