test_quantconnect_api
Test QuantConnect API connectivity by sending requests to specified endpoints. Verify authentication and API functionality with customizable HTTP methods and endpoints.
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. It is decorated with @mcp.tool() which also serves as its registration in the FastMCP server. This function tests QuantConnect API connectivity by making an authenticated request to the specified endpoint and returns the response details.@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}", }