mirror of
https://github.com/Xe138/AI-Trader.git
synced 2026-04-04 10:07:23 -04:00
init update
This commit is contained in:
20
agent_tools/tool_math.py
Normal file
20
agent_tools/tool_math.py
Normal file
@@ -0,0 +1,20 @@
|
||||
from fastmcp import FastMCP
|
||||
import os
|
||||
from dotenv import load_dotenv
|
||||
load_dotenv()
|
||||
|
||||
mcp = FastMCP("Math")
|
||||
|
||||
@mcp.tool()
|
||||
def add(a: float, b: float) -> float:
|
||||
"""Add two numbers (supports int and float)"""
|
||||
return float(a) + float(b)
|
||||
|
||||
@mcp.tool()
|
||||
def multiply(a: float, b: float) -> float:
|
||||
"""Multiply two numbers (supports int and float)"""
|
||||
return float(a) * float(b)
|
||||
|
||||
if __name__ == "__main__":
|
||||
port = int(os.getenv("MATH_HTTP_PORT", "8000"))
|
||||
mcp.run(transport="streamable-http", port=port)
|
||||
Reference in New Issue
Block a user