validate_provider
Check if the YouTube search provider functions correctly to ensure reliable video search and download operations within the MCP server environment.
Instructions
Validate that the YouTube search provider is working correctly.
Returns: JSON with validation status and provider information
Example: validate_provider()
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- The implementation of the validate_provider tool, which checks the status of the search provider and returns a JSON response.
@mcp.tool() async def validate_provider() -> str: """ Validate that the YouTube search provider is working correctly. Returns: JSON with validation status and provider information Example: validate_provider() """ try: provider = get_search_provider() is_valid = await provider.validate_connection() return json.dumps( { "valid": is_valid, "provider": "yt-dlp", "status": "operational" if is_valid else "error", }, indent=2, ) except Exception as e: logger.error(f"Provider validation failed: {e}") return json.dumps( {"valid": False, "provider": "yt-dlp", "status": "error", "error": str(e)}, indent=2 ) - src/youtube_search_mcp/tools/utility_tools.py:13-13 (registration)The function that registers the utility tools, including validate_provider, with the MCP server.
def register_utility_tools(mcp: FastMCP) -> None: