diff --git a/src/server.py b/src/server.py index 84da950..3282d5b 100644 --- a/src/server.py +++ b/src/server.py @@ -196,6 +196,18 @@ async def list_tools() -> list[Tool]: description="Get recent trades with P/L details", inputSchema={"type": "object", "properties": {}, "required": []}, ), + Tool( + name="monthly_performance", + description="Get monthly trade performance analytics (win rate, P/L, exit reasons, TP/SL used)", + inputSchema={ + "type": "object", + "properties": { + "year": {"type": "integer", "description": "Year (e.g., 2026)"}, + "month": {"type": "integer", "description": "Month (1-12)"}, + }, + "required": ["year", "month"], + }, + ), Tool( name="expectancy", description="Get trading expectancy metrics for all symbols", @@ -632,6 +644,10 @@ async def call_tool(name: str, arguments: dict[str, Any]) -> list[TextContent]: result = await api_get("/api/correlations/top") case "trades": result = await api_get("/api/dashboard/trades") + case "monthly_performance": + year = arguments.get("year") + month = arguments.get("month") + result = await api_get(f"/api/trades/monthly/{year}/{month}") case "expectancy": result = await api_get("/api/expectancy/") case "profitable_symbols":