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 <noreply@anthropic.com>
This commit is contained in:
Christian Gick
2026-01-20 11:21:14 +02:00
parent 16ee24d45f
commit 823b8b4297

View File

@@ -196,6 +196,18 @@ async def list_tools() -> list[Tool]:
description="Get recent trades with P/L details", description="Get recent trades with P/L details",
inputSchema={"type": "object", "properties": {}, "required": []}, 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( Tool(
name="expectancy", name="expectancy",
description="Get trading expectancy metrics for all symbols", 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") result = await api_get("/api/correlations/top")
case "trades": case "trades":
result = await api_get("/api/dashboard/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": case "expectancy":
result = await api_get("/api/expectancy/") result = await api_get("/api/expectancy/")
case "profitable_symbols": case "profitable_symbols":