test_quantconnect_api
Verify QuantConnect API connectivity and authentication status to ensure trading platform integration functions correctly.
Instructions
Test QuantConnect API connectivity with current authentication.
Args: endpoint: API endpoint to test (default: authenticate) method: HTTP method to use (default: POST)
Returns: Dictionary containing API test results
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| endpoint | No | authenticate | |
| method | No | POST |
Implementation Reference
- The handler function for the 'test_quantconnect_api' tool. Decorated with @mcp.tool() for automatic schema generation from type hints and docstring, and registration with the MCP server. Tests QuantConnect API connectivity by making an authenticated HTTP request to the specified endpoint.@mcp.tool() async def test_quantconnect_api( endpoint: str = "authenticate", method: str = "POST" ) -> Dict[str, Any]: """ Test QuantConnect API connectivity with current authentication. Args: endpoint: API endpoint to test (default: authenticate) method: HTTP method to use (default: POST) Returns: Dictionary containing API test results """ try: auth = get_auth_instance() if auth is None: return { "status": "error", "error": "Authentication not configured", "message": "Configure authentication first using configure_quantconnect_auth", } # Make API request response = await auth.make_authenticated_request(endpoint, method) # Parse response try: response_data = response.json() except: response_data = {"raw_content": response.text} return { "status": "success", "endpoint": endpoint, "method": method, "status_code": response.status_code, "response_data": response_data, "headers": dict(response.headers), "success": response.status_code == 200, } except Exception as e: return { "status": "error", "error": str(e), "message": f"Failed to test API endpoint: {endpoint}", }