Add get_latest_report tool with equity chart support
**New Tool: get_latest_report** - Returns the most recent backtest report from the database - Includes full report details: metrics, paths, tags, notes, verdict - Optional include_chart parameter (default: true) - Returns equity chart as base64 PNG when available **Implementation:** - ReportDb.get_latest(): Query for most recent report by created_at DESC - handle_get_latest_report(): Fetches report and reads equity.png from charts_dir - Base64 encoding using base64 crate v0.22 - Graceful handling when chart not found (equity_chart_error field) **Files Changed:** - storage/database.rs: Added get_latest() method - tools/definitions.rs: Added tool_get_latest_report() definition - tools/handlers/mod.rs: Added dispatch for get_latest_report - tools/handlers/reports.rs: Implemented handler with base64 chart encoding - Cargo.toml: Added base64 = 0.22 dependency
This commit is contained in:
@@ -62,6 +62,7 @@ impl ToolHandler {
|
||||
"list_set_files" => setfiles::handle_list_set_files(&self.config).await,
|
||||
|
||||
// Report handlers
|
||||
"get_latest_report" => reports::handle_get_latest_report(&self.config, args).await,
|
||||
"list_reports" => reports::handle_list_reports(args).await,
|
||||
"search_reports" => reports::handle_search_reports(args).await,
|
||||
"prune_reports" => reports::handle_prune_reports(&self.config, args).await,
|
||||
|
||||
Reference in New Issue
Block a user