check_api_health
Verify the operational status of the MusicMCP.AI API to ensure music generation services are available and functioning correctly.
Instructions
Check the health status of the MusicMCP.AI API service.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- musicmcp_ai_mcp/api.py:420-439 (handler)The @mcp.tool decorator registers the 'check_api_health' tool and defines its handler function, which performs a GET request to the /health endpoint of the MusicMCP.AI API and returns a TextContent with the health status.@mcp.tool(description="Check the health status of the MusicMCP.AI API service.") async def check_api_health() -> TextContent: """Check API service health status""" try: url = f"{api_url}/health" async with httpx.AsyncClient(timeout=httpx.Timeout(10.0)) as client: response = await client.get(url) response.raise_for_status() result = response.json() # API response format: {success, message, data} if result and result.get("success"): return TextContent(type="text", text="✅ MusicMCP.AI API service is healthy and operational.") else: return TextContent(type="text", text="⚠️ MusicMCP.AI API service health check failed.") except Exception as e: return TextContent(type="text", text=f"❌ Failed to check API health: {str(e)}")
- musicmcp_ai_mcp/api.py:420-420 (registration)The registration of the check_api_health tool via the FastMCP @mcp.tool decorator, which uses the function name as the tool name.@mcp.tool(description="Check the health status of the MusicMCP.AI API service.")