From 823b8b4297b09ecdd233fc7546ee5f5ba6a898a9 Mon Sep 17 00:00:00 2001 From: Christian Gick Date: Tue, 20 Jan 2026 11:21:14 +0200 Subject: [PATCH] feat(GB-51): Add monthly_performance MCP tool - Add monthly_performance tool with year/month parameters - Calls /api/trades/monthly/{year}/{month} endpoint - Returns comprehensive monthly analytics Enables January 2026 loss analysis via Claude Code. Co-Authored-By: Claude Sonnet 4.5 --- src/server.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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":