Skip to main content
Glama

Crawl4AI MCP Server

debug_schema.py•1.4 kB
#!/usr/bin/env python3 """Debug script for crawl_with_schema tool.""" import asyncio import json from fastmcp import Client from crawl4ai_mcp_server import mcp async def debug_crawl_with_schema(): """Debug the crawl_with_schema tool to see exact output.""" print("šŸ” Debugging crawl_with_schema tool...") try: async with Client(mcp) as client: test_url = "https://httpbin.org/html" test_schema = json.dumps({ "title": "h1", "body": "p" }) result = await client.call_tool("crawl_with_schema", { "url": test_url, "extraction_schema": test_schema }) print("Raw result:", result) if result and hasattr(result, 'content') and result.content: content_item = result.content[0] if isinstance(result.content, list) else result.content print("Content text:", content_item.text) response = json.loads(content_item.text) print("Parsed response:", json.dumps(response, indent=2)) print("Success field:", response.get("success")) print("Extracted data:", response.get("extracted_data")) except Exception as e: print(f"Error: {str(e)}") if __name__ == "__main__": asyncio.run(debug_crawl_with_schema())

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/Nexus-Digital-Automations/crawl4ai-mcp'

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