fetch_backtest_status
Check the execution status and retrieve the latest results of a cryptocurrency trading strategy backtest in Freqtrade.
Instructions
Get current backtest execution status and latest result payload.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- __main__.py:370-374 (handler)The main handler function for 'fetch_backtest_status' tool. Decorated with @mcp.tool(), it retrieves the backtest execution status by calling _client_get with the 'backtest' endpoint. Takes a Context parameter and returns the result as a string.
@mcp.tool() def fetch_backtest_status(ctx: Context) -> str: """Get current backtest execution status and latest result payload.""" client: FtRestClient = ctx.request_context.lifespan_context["client"] return str(_client_get(client, "backtest")) - __main__.py:37-43 (helper)Core helper function that dynamically calls client methods with fallback support for multiple freqtrade-client versions. Used by _client_get to make HTTP requests.
def _call_client_method(client: FtRestClient, method_names: List[str], *args, **kwargs): """Call first matching client method to support multiple freqtrade-client versions.""" for method_name in method_names: method = getattr(client, method_name, None) if callable(method): return method(*args, **kwargs) raise AttributeError(f"No supported method found in {method_names}") - __main__.py:46-47 (helper)Helper function that wraps _call_client_method for making HTTP GET requests to the freqtrade client. Used by fetch_backtest_status to retrieve backtest status.
def _client_get(client: FtRestClient, path: str, params: Dict[str, Any] | None = None): return _call_client_method(client, ["_get"], path, params=params)