Reorganize tool definitions into granular domain modules
**New structure:** src/tools/definitions/ ├── mod.rs # Aggregates all 43 tools ├── system.rs # 3 tools: healthcheck, verify_setup, list_symbols ├── experts.rs # 4 tools: compile_ea, list_experts, list_indicators, list_scripts ├── backtest.rs # 4 tools: run_backtest, get_backtest_status, cache_status, clean_cache ├── optimization.rs # 4 tools: run_optimization, get_optimization_status, get_optimization_results, list_jobs ├── analytics.rs # 9 tools: analyze_report + 8 granular analytics ├── reports.rs # 11 tools: list_reports, search_reports, get_latest_report, etc. ├── setfiles.rs # 8 tools: read/write/patch/clone/diff set files └── baseline.rs # 1 tool: compare_baseline **Benefits:** - Domain-based organization (21KB monolith -> 9 focused files) - Each domain can evolve independently - Easier to find and modify tool definitions - Clear separation between system, experts, backtest, optimization, analytics, reports, setfiles
This commit is contained in:
@@ -0,0 +1,55 @@
|
||||
use serde_json::{json, Value};
|
||||
|
||||
pub fn tool_compile_ea() -> Value {
|
||||
json!({
|
||||
"name": "compile_ea",
|
||||
"description": "Compile an MQL5 Expert Advisor via MetaEditor. Provide either 'expert' (EA name, searches project and MT5 Experts dirs) or 'expert_path' (full path to .mq5 file).",
|
||||
"inputSchema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"expert": { "type": "string", "description": "EA name without extension (e.g. 'DPS21')" },
|
||||
"expert_path": { "type": "string", "description": "Full path to the .mq5 source file" }
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
pub fn tool_list_experts() -> Value {
|
||||
json!({
|
||||
"name": "list_experts",
|
||||
"description": "List all compiled Expert Advisors",
|
||||
"inputSchema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"filter": { "type": "string" }
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
pub fn tool_list_indicators() -> Value {
|
||||
json!({
|
||||
"name": "list_indicators",
|
||||
"description": "List all custom indicators in MQL5/Indicators",
|
||||
"inputSchema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"filter": { "type": "string", "description": "Optional name filter pattern" },
|
||||
"include_builtin": { "type": "boolean", "description": "Include built-in MT5 indicators", "default": false }
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
pub fn tool_list_scripts() -> Value {
|
||||
json!({
|
||||
"name": "list_scripts",
|
||||
"description": "List all scripts in MQL5/Scripts",
|
||||
"inputSchema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"filter": { "type": "string", "description": "Optional name filter pattern" }
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user