search_public_queries
Find Dune Analytics queries by keyword to discover relevant table names and SQL examples for data analysis.
Instructions
Search public queries by keyword. Use this to discover table names from existing SQL.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes |
Implementation Reference
- src/main.py:91-110 (handler)This is the main handler function for the 'search_public_queries' tool. It is decorated with @mcp.tool(), which serves as both the implementation and registration in FastMCP. It searches public Dune queries using dune_service and formats the results.@mcp.tool() def search_public_queries(query: str) -> str: """ Search public queries by keyword. Use this to discover table names from existing SQL. """ results = dune_service.search_queries(query) # Handle WAF/Error if isinstance(results, dict) and "error" in results: return f"Error: {results['error']}" if not results: return f"No public queries found matching '{query}'." # Format as string summary summary = [] for q in results[:10]: # Limit to 10 summary.append(f"ID: {q.get('id')} | Name: {q.get('name')} | Owner: {q.get('owner')}") return "\n".join(summary)