Skip to main content
Glama

estimate_optimization_time

Estimate execution time for algorithmic trading strategy optimization using specified parameters and node configuration.

Instructions

Estimate the execution time of an optimization with the specified parameters.

Args: project_id: ID of the project to optimize compile_id: Compile ID from successful project compilation node_type: Type of node to use for optimization parameters: Dictionary of optimization parameters

Returns: Dictionary containing estimated optimization time

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_idYes
compile_idYes
node_typeYes
parametersYes

Implementation Reference

  • The core handler function for the 'estimate_optimization_time' tool. It makes an authenticated API request to QuantConnect's optimizations/estimate endpoint to estimate the execution time based on project details and parameters.
    @mcp.tool() async def estimate_optimization_time( project_id: int, compile_id: str, node_type: str, parameters: Dict[str, Any], ) -> Dict[str, Any]: """ Estimate the execution time of an optimization with the specified parameters. Args: project_id: ID of the project to optimize compile_id: Compile ID from successful project compilation node_type: Type of node to use for optimization parameters: Dictionary of optimization parameters Returns: Dictionary containing estimated optimization time """ auth = get_auth_instance() if auth is None: return { "status": "error", "error": "QuantConnect authentication not configured. Use configure_auth() first.", } try: # Prepare request data request_data = { "projectId": project_id, "compileId": compile_id, "nodeType": node_type, "parameters": parameters, } # Make API request response = await auth.make_authenticated_request( endpoint="optimizations/estimate", method="POST", json=request_data ) # Parse response if response.status_code == 200: data = response.json() if data.get("success", False): return { "status": "success", "project_id": project_id, "compile_id": compile_id, "node_type": node_type, "estimated_time": data.get("estimatedTime"), "message": f"Successfully estimated optimization time for project {project_id}", } else: # API returned success=false errors = data.get("errors", ["Unknown error"]) return { "status": "error", "error": "Optimization time estimation failed", "details": errors, "project_id": project_id, "compile_id": compile_id, } elif response.status_code == 401: return { "status": "error", "error": "Authentication failed. Check your credentials and ensure they haven't expired.", } else: return { "status": "error", "error": f"API request failed with status {response.status_code}", "response_text": ( response.text[:500] if hasattr(response, "text") else "No response text" ), } except Exception as e: return { "status": "error", "error": f"Failed to estimate optimization time: {str(e)}", "project_id": project_id, "compile_id": compile_id, }
  • Registration of optimization tools (including estimate_optimization_time) by calling register_optimization_tools(mcp) in the main server setup.
    register_optimization_tools(mcp)

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/taylorwilsdon/quantconnect-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server