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:
@@ -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":
|
||||
|
||||
Reference in New Issue
Block a user